mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 02:14:56 +02:00
Hiding of environment variables (#362)
* Remember environment variables from previous scope * Re-introduce env var hiding Right now, hiding decls is broken * Re-introduce hidden field of import patterns All tests pass now. * Remove/Address tests TODOs * Fix test typo; Report hiding error * Add a few more tests * Fix wrong expected test result
This commit is contained in:
4
crates/nu-command/src/env/with_env.rs
vendored
4
crates/nu-command/src/env/with_env.rs
vendored
@ -163,10 +163,10 @@ fn with_env(
|
||||
for (k, v) in env {
|
||||
match v {
|
||||
EnvVar::Nothing => {
|
||||
stack.env_vars.remove(&k);
|
||||
stack.remove_env_var(&k);
|
||||
}
|
||||
EnvVar::Proper(s) => {
|
||||
stack.env_vars.insert(k, s);
|
||||
stack.add_env_var(k, s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user