Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ pub trait Backend: Debug + Send + Sync {
.env(&*env::PATH_KEY, plugins::core::path_env_with_tv_path(tv)?)
.env("MISE_TOOL_INSTALL_PATH", tv.install_path())
.with_pr(&ctx.pr)
.arg("-c")
.arg(env::SHELL_COMMAND_FLAG)
.arg(script)
.envs(self.exec_env(&ctx.config, &ctx.ts, tv).await?)
.execute()?;
Expand Down
11 changes: 4 additions & 7 deletions src/cli/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,10 @@ fn parse_command(
let (program, args) = command.split_first().unwrap();
(program.clone(), args.into())
}
_ => {
#[cfg(unix)]
let command_flag = "-c";
#[cfg(windows)]
let command_flag = "/c";
(shell.into(), vec![command_flag.into(), c.clone().unwrap()])
}
_ => (
shell.into(),
vec![env::SHELL_COMMAND_FLAG.into(), c.clone().unwrap()],
),
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ pub static MISE_SHELL: Lazy<Option<ShellType>> = Lazy::new(|| {
.parse()
.ok()
});
#[cfg(unix)]
pub static SHELL_COMMAND_FLAG: &str = "-c";
#[cfg(windows)]
pub static SHELL_COMMAND_FLAG: &str = "/c";

// paths and directories
#[cfg(test)]
Expand Down
Loading