Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/commands/edge_app/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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()
)));
}

Expand Down
2 changes: 1 addition & 1 deletion src/commands/edge_app/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>) -> Result<PathBuf, CommandError> {
Expand Down
Loading