From 7a7a577033db48a2862131f2f465fb508c5ee37a Mon Sep 17 00:00:00 2001 From: Leah Date: Thu, 4 Aug 2022 23:58:19 +0200 Subject: [PATCH] add `open-browser` option (#199) Fixes https://github.com/vercel/turbo-tooling/issues/171 --- crates/next-dev/src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/next-dev/src/main.rs b/crates/next-dev/src/main.rs index 1548d9188746f..28c4b323d3fc8 100644 --- a/crates/next-dev/src/main.rs +++ b/crates/next-dev/src/main.rs @@ -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] @@ -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! {