forked from extern/nushell
Set env in exec command (#8917)
# Description Previously variables with `let-env` were not available after doing an `exec` command. This PR fixes that # User-Facing Changes Can now use environment variables set with nushell after `exec` # Tests + Formatting No tests made but formatting has been checked # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> Co-authored-by: Jelle Besseling <jelle@bigbridge.nl>
This commit is contained in:
parent
d42c2b2dbc
commit
c8f54476c9
@ -81,6 +81,7 @@ fn exec(
|
|||||||
let cwd = current_dir(engine_state, stack)?;
|
let cwd = current_dir(engine_state, stack)?;
|
||||||
let mut command = external_command.spawn_simple_command(&cwd.to_string_lossy())?;
|
let mut command = external_command.spawn_simple_command(&cwd.to_string_lossy())?;
|
||||||
command.current_dir(cwd);
|
command.current_dir(cwd);
|
||||||
|
command.envs(&external_command.env_vars);
|
||||||
|
|
||||||
let err = command.exec(); // this replaces our process, should not return
|
let err = command.exec(); // this replaces our process, should not return
|
||||||
|
|
||||||
|
@ -548,7 +548,7 @@ impl ExternalCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_process(
|
pub fn create_process(
|
||||||
&self,
|
&self,
|
||||||
input: &PipelineData,
|
input: &PipelineData,
|
||||||
use_cmd: bool,
|
use_cmd: bool,
|
||||||
|
Loading…
Reference in New Issue
Block a user