diff --git a/Cargo.lock b/Cargo.lock index cefcd3f..ff2933a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3100,7 +3100,7 @@ dependencies = [ [[package]] name = "wavedash" -version = "0.1.87" +version = "0.1.88" dependencies = [ "anyhow", "axum", diff --git a/Cargo.toml b/Cargo.toml index 4140959..d03ebbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wavedash" -version = "0.1.87" +version = "0.1.88" edition = "2021" authors = ["Wavedash Team"] description = "Cross-platform CLI tool for uploading game projects to wavedash.com" diff --git a/src/dev/mod.rs b/src/dev/mod.rs index 5a443d9..e7bf0eb 100644 --- a/src/dev/mod.rs +++ b/src/dev/mod.rs @@ -54,7 +54,7 @@ async fn create_local_build( const DEFAULT_CONFIG: &str = "./wavedash.toml"; -pub async fn handle_dev(config_path: Option, verbose: bool) -> Result<()> { +pub async fn handle_dev(config_path: Option, verbose: bool, no_open: bool) -> Result<()> { let auth_manager = AuthManager::new()?; let api_key = auth_manager .get_api_key() @@ -178,7 +178,11 @@ pub async fn handle_dev(config_path: Option, verbose: bool) -> Result<( println!(" callback_uri: {}", callback_uri); println!(" state: {}", state_token); } - open::that(&local_url)?; + if no_open { + println!(" --no-open set; open {} in your browser to start.", local_url); + } else { + open::that(&local_url)?; + } server::run( listener, diff --git a/src/main.rs b/src/main.rs index 389e22d..91431ae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -74,6 +74,11 @@ enum Commands { help = "Path to wavedash.toml config file" )] config: Option, + #[arg( + long = "no-open", + help = "Don't automatically open the browser; just print the local URL" + )] + no_open: bool, }, #[command( about = "Publish an uploaded build to wavedash.com", @@ -430,8 +435,8 @@ async fn run() -> Result<()> { handle_build_push(config, cli.verbose, message).await?; } }, - Commands::Dev { config } => { - handle_dev(config, cli.verbose).await?; + Commands::Dev { config, no_open } => { + handle_dev(config, cli.verbose, no_open).await?; } Commands::Publish { config,