mirror of
https://github.com/nushell/nushell
synced 2024-12-26 04:53:09 +00:00
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
2 changed files with 2 additions and 1 deletions
|
@ -81,6 +81,7 @@ fn exec(
|
|||
let cwd = current_dir(engine_state, stack)?;
|
||||
let mut command = external_command.spawn_simple_command(&cwd.to_string_lossy())?;
|
||||
command.current_dir(cwd);
|
||||
command.envs(&external_command.env_vars);
|
||||
|
||||
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,
|
||||
input: &PipelineData,
|
||||
use_cmd: bool,
|
||||
|
|
Loading…
Reference in a new issue