windows specific command for tool emulation

This commit is contained in:
Michael Neale
2025-11-10 14:02:18 +11:00
parent 09bb5b39e6
commit 9dd4eb7cd0
+10 -3
View File
@@ -1438,11 +1438,18 @@ impl ToolExecutor {
if let Some(command) = args.get("command").and_then(|v| v.as_str()) {
tracing::info!("Executing shell command: {}", command);
match std::process::Command::new("sh")
#[cfg(target_os = "windows")]
let output_result = std::process::Command::new("cmd")
.args(["/C", command])
.output();
#[cfg(not(target_os = "windows"))]
let output_result = std::process::Command::new("sh")
.arg("-c")
.arg(command)
.output()
{
.output();
match output_result {
Ok(output) => {
let stdout = String::from_utf8_lossy(&output.stdout);
let stderr = String::from_utf8_lossy(&output.stderr);