mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 03:48:04 +02:00
Revert "Remove std::env::set_current_dir()
call from EngineState::merge_env()
" (#12954)
Reverts nushell/nushell#12922
This commit is contained in:
@ -277,7 +277,11 @@ impl EngineState {
|
||||
}
|
||||
|
||||
/// Merge the environment from the runtime Stack into the engine state
|
||||
pub fn merge_env(&mut self, stack: &mut Stack) -> Result<(), ShellError> {
|
||||
pub fn merge_env(
|
||||
&mut self,
|
||||
stack: &mut Stack,
|
||||
cwd: impl AsRef<Path>,
|
||||
) -> Result<(), ShellError> {
|
||||
let mut config_updated = false;
|
||||
|
||||
for mut scope in stack.env_vars.drain(..) {
|
||||
@ -307,6 +311,9 @@ impl EngineState {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: better error
|
||||
std::env::set_current_dir(cwd)?;
|
||||
|
||||
if config_updated {
|
||||
// Make plugin GC config changes take effect immediately.
|
||||
#[cfg(feature = "plugin")]
|
||||
|
Reference in New Issue
Block a user