diff --git a/src/commands/edge_app/server.rs b/src/commands/edge_app/server.rs index 7bb2bd1..681431e 100644 --- a/src/commands/edge_app/server.rs +++ b/src/commands/edge_app/server.rs @@ -258,10 +258,10 @@ impl EdgeAppCommand { } fn open_browser(&self, address: &str) -> Result<(), CommandError> { - let command = match std::env::consts::OS { - "macos" => "open", - "windows" => "start", - "linux" => "xdg-open", + let (command, args) = match std::env::consts::OS { + "macos" => ("open", vec![address]), + "windows" => ("cmd", vec!["/C", "start", "", address]), + "linux" => ("xdg-open", vec![address]), _ => { return Err(CommandError::OpenBrowserError( "Unsupported OS to open browser".to_string(), @@ -270,14 +270,14 @@ impl EdgeAppCommand { }; let output = std::process::Command::new(command) - .arg(address) + .args(&args) .output() .expect("Failed to open browser"); if !output.status.success() { return Err(CommandError::OpenBrowserError(format!( "Failed to open browser: {}", - str::from_utf8(&output.stderr).unwrap() + std::str::from_utf8(&output.stderr).unwrap() ))); } diff --git a/src/commands/edge_app/utils.rs b/src/commands/edge_app/utils.rs index 84a77e4..f9850f5 100644 --- a/src/commands/edge_app/utils.rs +++ b/src/commands/edge_app/utils.rs @@ -70,7 +70,7 @@ fn is_included(entry: &DirEntry, ignore: &Ignorer) -> bool { return false; } - return !ignore.is_ignored(entry.path()); + !ignore.is_ignored(entry.path()) } pub fn transform_edge_app_path_to_manifest(path: &Option) -> Result {