fix: swap command executors for Windows and Linux

This commit is contained in:
Andrew Rioux 2025-10-21 08:19:32 -04:00
parent 7f9ea12b6a
commit 135576c5d3
Signed by: andrew.rioux
GPG Key ID: 9B8BAC47C17ABB94

View File

@ -46,15 +46,15 @@ impl super::Action for Exec {
let mut output: Vec<String> = Vec::new(); let mut output: Vec<String> = Vec::new();
let mut cmd = if cfg!(target_os = "windows") { let mut cmd = if cfg!(target_os = "windows") {
Command::new("sh") Command::new(r"C:\Windows\System32\cmd.exe")
.arg("-c") .arg("/c")
.arg(self.exec_cmd.clone()) .arg(self.exec_cmd.clone())
.stdout(Stdio::piped()) .stdout(Stdio::piped())
.stderr(Stdio::piped()) .stderr(Stdio::piped())
.spawn()? .spawn()?
} else { } else {
Command::new("cmd.exe") Command::new("sh")
.arg("/c") .arg("-c")
.arg(self.exec_cmd.clone()) .arg(self.exec_cmd.clone())
.stdout(Stdio::piped()) .stdout(Stdio::piped())
.stderr(Stdio::piped()) .stderr(Stdio::piped())