Skip to content

Commit

Permalink
add open-browser option (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony authored Aug 4, 2022
1 parent c229820 commit 7a7a577
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/next-dev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ struct Cli {
/// parent asset is requested
#[clap(long)]
eager_compile: bool,

/// Don't open the browser automatically when the dev server has started.
#[clap(long)]
no_open: bool,
}

#[tokio::main]
Expand Down Expand Up @@ -79,7 +83,9 @@ async fn main() {
format!("http://{}", server.addr)
};
println!("server listening on: {uri}", uri = index_uri);
let _ = webbrowser::open(&index_uri);
if !args.no_open {
let _ = webbrowser::open(&index_uri);
}
}

join! {
Expand Down

0 comments on commit 7a7a577

Please # to comment.