From ffd467909fd9e19e7c7b03a573848d5b04b2280a Mon Sep 17 00:00:00 2001 From: Takahiro Ebato Date: Thu, 12 Dec 2024 01:47:34 +0900 Subject: [PATCH] fix(watch): watch command require tasks argument (#9598) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Description ### Testing Instructions --- crates/turborepo-lib/src/cli/mod.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/turborepo-lib/src/cli/mod.rs b/crates/turborepo-lib/src/cli/mod.rs index 4082a63a6fceb..88a8e84b54645 100644 --- a/crates/turborepo-lib/src/cli/mod.rs +++ b/crates/turborepo-lib/src/cli/mod.rs @@ -1469,10 +1469,15 @@ pub async fn run( Ok(query) } - Command::Watch(_) => { + Command::Watch(execution_args) => { let event = CommandEventBuilder::new("watch").with_parent(&root_telemetry); event.track_call(); - let base = CommandBase::new(cli_args, repo_root, version, color_config)?; + let base = CommandBase::new(cli_args.clone(), repo_root, version, color_config)?; + + if execution_args.tasks.is_empty() { + print_potential_tasks(base, event).await?; + return Ok(1); + } let mut client = WatchClient::new(base, event).await?; if let Err(e) = client.start().await {