liyixin f9d33e4797
fix(windows): use cmd on windows instead of sh (#102)
Co-authored-by: liyixin <root@liyixin-test.sci-inv.cn>
2024-12-06 10:37:44 +01:00

20 lines
277 B
Rust

use std::process::Command;
#[cfg(not(windows))]
pub fn shell_command() -> Command {
let mut cmd = Command::new("sh");
cmd.arg("-c");
cmd
}
#[cfg(windows)]
pub fn shell_command() -> Command {
let mut cmd = Command::new("cmd");
cmd.arg("/c");
cmd
}