mirror of
https://github.com/danbulant/nushell
synced 2026-05-23 06:19:25 +00:00
add home-path to $nu (#468)
This commit is contained in:
parent
d0119ea05d
commit
4103abc685
1 changed files with 10 additions and 0 deletions
|
|
@ -520,6 +520,16 @@ pub fn eval_variable(
|
|||
}
|
||||
}
|
||||
|
||||
if let Some(home_path) = nu_path::home_dir() {
|
||||
if let Some(home_path_str) = home_path.to_str() {
|
||||
output_cols.push("home-path".into());
|
||||
output_vals.push(Value::String {
|
||||
val: home_path_str.into(),
|
||||
span,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if let Ok(cwd) = std::env::var("PWD") {
|
||||
output_cols.push("pwd".into());
|
||||
output_vals.push(Value::String { val: cwd, span })
|
||||
|
|
|
|||
Loading…
Reference in a new issue