address feedback
This commit is contained in:
@@ -206,12 +206,13 @@ pub fn ensure_daemon(session: &str, headed: bool) -> Result<(), String> {
|
|||||||
{
|
{
|
||||||
use std::os::windows::process::CommandExt;
|
use std::os::windows::process::CommandExt;
|
||||||
|
|
||||||
// On Windows, use cmd.exe to run node to ensure proper PATH resolution
|
// On Windows, use cmd.exe to run node to ensure proper PATH resolution.
|
||||||
// This handles cases where node.exe isn't directly in PATH but node.cmd is
|
// This handles cases where node.exe isn't directly in PATH but node.cmd is.
|
||||||
|
// Pass the entire command as a single string to /c to handle paths with spaces.
|
||||||
|
let cmd_string = format!("node \"{}\"", daemon_path.display());
|
||||||
let mut cmd = Command::new("cmd");
|
let mut cmd = Command::new("cmd");
|
||||||
cmd.arg("/c")
|
cmd.arg("/c")
|
||||||
.arg("node")
|
.arg(&cmd_string)
|
||||||
.arg(daemon_path)
|
|
||||||
.env("AGENT_BROWSER_DAEMON", "1")
|
.env("AGENT_BROWSER_DAEMON", "1")
|
||||||
.env("AGENT_BROWSER_SESSION", session);
|
.env("AGENT_BROWSER_SESSION", session);
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -130,10 +130,11 @@ pub fn run_install(with_deps: bool) {
|
|||||||
println!("\x1b[36mInstalling Chromium browser...\x1b[0m");
|
println!("\x1b[36mInstalling Chromium browser...\x1b[0m");
|
||||||
|
|
||||||
// On Windows, we need to use cmd.exe to run npx because npx is actually npx.cmd
|
// 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
|
// 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)]
|
#[cfg(windows)]
|
||||||
let status = Command::new("cmd")
|
let status = Command::new("cmd")
|
||||||
.args(["/c", "npx", "playwright", "install", "chromium"])
|
.args(["/c", "npx playwright install chromium"])
|
||||||
.status();
|
.status();
|
||||||
|
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
|
|||||||
Reference in New Issue
Block a user