mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 10:08:21 +02:00
add home-path
to $nu
(#468)
This commit is contained in:
@ -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") {
|
if let Ok(cwd) = std::env::var("PWD") {
|
||||||
output_cols.push("pwd".into());
|
output_cols.push("pwd".into());
|
||||||
output_vals.push(Value::String { val: cwd, span })
|
output_vals.push(Value::String { val: cwd, span })
|
||||||
|
Reference in New Issue
Block a user