Skip to content

Commit

Permalink
Edits: 'edge-app run' open in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
rusko124 committed Jul 2, 2024
1 parent 173a664 commit 89f089f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/commands/edge_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,28 @@ impl EdgeAppCommand {
address_shared.lock().unwrap().as_ref().unwrap()
);

#[cfg(target_os = "macos")]
{
let _ = std::process::Command::new("open")
.arg(format!("{}/index.html", address_shared.lock().unwrap().as_ref().unwrap()))
.output();
}

#[cfg(target_os = "linux")]
{
let _ = std::process::Command::new("xdg-open")
.arg(format!("{}/index.html", address_shared.lock().unwrap().as_ref().unwrap()))
.output();
}

#[cfg(target_os = "windows")]
{
let _ = std::process::Command::new("cmd")
.arg("/C")
.arg(format!("start {}/index.html", address_shared.lock().unwrap().as_ref().unwrap()))
.output();
}

loop {
tokio::time::sleep(std::time::Duration::from_secs(3600)).await;
}
Expand Down

0 comments on commit 89f089f

Please sign in to comment.