mirror of
https://github.com/nushell/nushell.git
synced 2024-11-26 18:33:50 +01:00
Move outside of loop
This commit is contained in:
parent
831111edec
commit
1e11f0713a
2
crates/nu-cli/src/env/environment_syncer.rs
vendored
2
crates/nu-cli/src/env/environment_syncer.rs
vendored
@ -44,6 +44,7 @@ impl EnvironmentSyncer {
|
||||
pub fn sync_env_vars(&mut self, ctx: &mut Context) {
|
||||
let mut environment = self.env.lock();
|
||||
|
||||
environment.maintain_directory_environment().ok();
|
||||
if environment.env().is_some() {
|
||||
for (name, value) in ctx.with_host(|host| host.vars()) {
|
||||
if name != "path" && name != "PATH" {
|
||||
@ -51,7 +52,6 @@ impl EnvironmentSyncer {
|
||||
// that aren't loaded from config.
|
||||
environment.add_env(&name, &value, false);
|
||||
|
||||
environment.maintain_directory_environment().ok();
|
||||
|
||||
// clear the env var from the session
|
||||
// we are about to replace them
|
||||
|
Loading…
Reference in New Issue
Block a user