add temp-path to $nu (#471)

This commit is contained in:
Darren Schroeder 2021-12-11 14:00:29 -06:00 committed by GitHub
parent c2aa6c708d
commit 9d7685e565
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -552,6 +552,15 @@ pub fn eval_variable(
}
}
let temp = std::env::temp_dir();
if let Some(temp_path) = temp.to_str() {
output_cols.push("temp-path".into());
output_vals.push(Value::String {
val: temp_path.into(),
span,
})
}
Ok(Value::Record {
cols: output_cols,
vals: output_vals,