diff --git a/crates/nu-command/src/system/exec.rs b/crates/nu-command/src/system/exec.rs index acf845f8f4..e988d18960 100644 --- a/crates/nu-command/src/system/exec.rs +++ b/crates/nu-command/src/system/exec.rs @@ -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 diff --git a/crates/nu-command/src/system/run_external.rs b/crates/nu-command/src/system/run_external.rs index 68c4299667..1de0513884 100644 --- a/crates/nu-command/src/system/run_external.rs +++ b/crates/nu-command/src/system/run_external.rs @@ -548,7 +548,7 @@ impl ExternalCommand { } } - fn create_process( + pub fn create_process( &self, input: &PipelineData, use_cmd: bool,