Skip to content

Commit

Permalink
fix(windows): make tasks work (#2591)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx authored Sep 18, 2024
1 parent fcc2d35 commit 64d3ed6
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,18 @@ impl Run {
let filename = file.display().to_string();
self.exec(&filename, args, task, env, prefix)
} else {
let script = format!("{} {}", script, shell_words::join(args));
let args = vec!["-c".to_string(), script];
self.exec("sh", &args, task, env, prefix)
#[cfg(windows)]
{
let script = format!("{} {}", script, args.join(" "));
let args = vec!["/c".to_string(), script];
self.exec("cmd", &args, task, env, prefix)
}
#[cfg(unix)]
{
let script = format!("{} {}", script, shell_words::join(args));
let args = vec!["-c".to_string(), script];
self.exec("sh", &args, task, env, prefix)
}
}
}

Expand Down

0 comments on commit 64d3ed6

Please sign in to comment.