mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
feat: pass env to shell command (#6863)
Signed-off-by: lsytj0413 <511121939@qq.com>
This commit is contained in:
@@ -8,7 +8,6 @@ use std::os::unix::process::CommandExt;
|
||||
pub struct ShellConfig {
|
||||
pub executable: String,
|
||||
pub args: Vec<String>,
|
||||
#[allow(dead_code)]
|
||||
pub envs: Vec<(OsString, OsString)>,
|
||||
}
|
||||
|
||||
@@ -129,8 +128,13 @@ pub fn configure_shell_command(
|
||||
.env("EDITOR", "sh -c 'echo \"Interactive editor not available in this environment.\" >&2; exit 1'")
|
||||
.env("GIT_TERMINAL_PROMPT", "0")
|
||||
.env("GIT_PAGER", "cat")
|
||||
.args(&shell_config.args)
|
||||
.arg(command);
|
||||
.args(&shell_config.args);
|
||||
|
||||
for (key, value) in &shell_config.envs {
|
||||
command_builder.env(key, value);
|
||||
}
|
||||
|
||||
command_builder.arg(command);
|
||||
|
||||
// On Unix systems, create a new process group so we can kill child processes
|
||||
#[cfg(unix)]
|
||||
|
||||
Reference in New Issue
Block a user