From 1e11f0713aac6f28cf0416634dfa1da1eac9a2e3 Mon Sep 17 00:00:00 2001 From: Sam Hedin Date: Wed, 17 Jun 2020 00:09:42 +0200 Subject: [PATCH] Move outside of loop --- crates/nu-cli/src/env/environment_syncer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/nu-cli/src/env/environment_syncer.rs b/crates/nu-cli/src/env/environment_syncer.rs index fbcd72e6a6..7c378ea47e 100644 --- a/crates/nu-cli/src/env/environment_syncer.rs +++ b/crates/nu-cli/src/env/environment_syncer.rs @@ -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