From 9d7685e56584be2cd01e5b0a830fdd69632b5305 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Sat, 11 Dec 2021 14:00:29 -0600 Subject: [PATCH] add `temp-path` to `$nu` (#471) --- crates/nu-engine/src/eval.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/nu-engine/src/eval.rs b/crates/nu-engine/src/eval.rs index d5353615e0..e2b6055686 100644 --- a/crates/nu-engine/src/eval.rs +++ b/crates/nu-engine/src/eval.rs @@ -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,