mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 07:33:18 +02:00
Fix let-env (#3057)
This commit is contained in:
@ -184,7 +184,7 @@ pub async fn process_script(
|
||||
trace!("{:#?}", block);
|
||||
let env = ctx.get_env();
|
||||
|
||||
ctx.scope.add_env(env);
|
||||
ctx.scope.add_env_to_base(env);
|
||||
let result = run_block(&block, ctx, input_stream).await;
|
||||
match result {
|
||||
Ok(input) => {
|
||||
|
@ -186,6 +186,12 @@ impl Scope {
|
||||
frame.env.extend(env_vars)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_env_to_base(&self, env_vars: IndexMap<String, String>) {
|
||||
if let Some(frame) = self.frames.lock().first_mut() {
|
||||
frame.env.extend(env_vars)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ParserScope for Scope {
|
||||
|
Reference in New Issue
Block a user