Add initial support for env vars

This commit is contained in:
Jonathan Turner
2019-11-02 16:41:58 +13:00
parent 2fe7d105b0
commit 129ee45944
2 changed files with 33 additions and 4 deletions

View File

@ -169,7 +169,9 @@ fn evaluate_reference(
x if x == "nu:env" => {
let mut dict = TaggedDictBuilder::new(&tag);
for v in std::env::vars() {
dict.insert(v.0, Value::string(v.1));
if v.0 != "PATH" && v.0 != "Path" {
dict.insert(v.0, Value::string(v.1));
}
}
Ok(dict.into_tagged_value())
}