forked from extern/nushell
Add a sync from the known path to the env (#3335)
This commit is contained in:
@ -98,6 +98,17 @@ impl EvaluationContext {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn sync_path_to_env(&self) {
|
||||
let env_vars = self.scope.get_env_vars();
|
||||
|
||||
for (var, val) in env_vars {
|
||||
if var == "PATH" || var == "Path" || var == "path" {
|
||||
std::env::set_var(var, val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub(crate) fn get_command(&self, name: &str) -> Option<Command> {
|
||||
self.scope.get_command(name)
|
||||
|
@ -101,6 +101,7 @@ pub fn process_script(
|
||||
})
|
||||
.unwrap_or("");
|
||||
|
||||
ctx.sync_path_to_env();
|
||||
if internal_name == "run_external"
|
||||
&& args
|
||||
.positional
|
||||
|
Reference in New Issue
Block a user