From f2d47f97da15e52248dd285c8ba0e1bd37dd4de3 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Tue, 19 Apr 2022 14:11:58 -0500 Subject: [PATCH] add os to $nu based on rust's understanding (#5243) * add os to $nu based on rust's understanding * add a few more constants --- crates/nu-engine/src/eval.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/nu-engine/src/eval.rs b/crates/nu-engine/src/eval.rs index dfdb9691c..56c24817e 100644 --- a/crates/nu-engine/src/eval.rs +++ b/crates/nu-engine/src/eval.rs @@ -1249,6 +1249,18 @@ pub fn eval_variable( output_cols.push("pid".into()); output_vals.push(Value::int(pid as i64, span)); + let os_record = Value::Record { + cols: vec!["os".into(), "arch".into(), "family".into()], + vals: vec![ + Value::string(std::env::consts::OS, span), + Value::string(std::env::consts::ARCH, span), + Value::string(std::env::consts::FAMILY, span), + ], + span, + }; + output_cols.push("os-info".into()); + output_vals.push(os_record); + Ok(Value::Record { cols: output_cols, vals: output_vals,