fix windows bug (#26)

* fix windows bug

* test windows

* address feedback
This commit is contained in:
Chris Tate
2026-01-12 10:33:21 -06:00
committed by GitHub
parent 574037080c
commit a4fcc1c198
3 changed files with 89 additions and 2 deletions
+10
View File
@@ -128,6 +128,16 @@ pub fn run_install(with_deps: bool) {
}
println!("\x1b[36mInstalling Chromium browser...\x1b[0m");
// On Windows, we need to use cmd.exe to run npx because npx is actually npx.cmd
// and Command::new() doesn't resolve .cmd files the way the shell does.
// Pass the entire command as a single string to /c to handle paths with spaces.
#[cfg(windows)]
let status = Command::new("cmd")
.args(["/c", "npx playwright install chromium"])
.status();
#[cfg(not(windows))]
let status = Command::new("npx")
.args(["playwright", "install", "chromium"])
.status();