mirror of
https://github.com/nushell/nushell
synced 2024-11-13 08:27:06 +00:00
Fix environment merging in hooks (#6309)
This commit is contained in:
parent
c3efb12733
commit
ccebdd7a7f
1 changed files with 3 additions and 5 deletions
|
@ -786,9 +786,6 @@ pub fn eval_hook(
|
||||||
for var_id in var_ids.iter() {
|
for var_id in var_ids.iter() {
|
||||||
stack.vars.remove(var_id);
|
stack.vars.remove(var_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
let cwd = get_guaranteed_cwd(engine_state, stack);
|
|
||||||
engine_state.merge_env(stack, cwd)?;
|
|
||||||
}
|
}
|
||||||
Value::Block {
|
Value::Block {
|
||||||
val: block_id,
|
val: block_id,
|
||||||
|
@ -796,8 +793,6 @@ pub fn eval_hook(
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
run_hook_block(engine_state, stack, block_id, arguments, block_span)?;
|
run_hook_block(engine_state, stack, block_id, arguments, block_span)?;
|
||||||
let cwd = get_guaranteed_cwd(engine_state, stack);
|
|
||||||
engine_state.merge_env(stack, cwd)?;
|
|
||||||
}
|
}
|
||||||
other => {
|
other => {
|
||||||
return Err(ShellError::UnsupportedConfigValue(
|
return Err(ShellError::UnsupportedConfigValue(
|
||||||
|
@ -825,6 +820,9 @@ pub fn eval_hook(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let cwd = get_guaranteed_cwd(engine_state, stack);
|
||||||
|
engine_state.merge_env(stack, cwd)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue