From f17e234b6e563c5c5a1df80fc67f0a34ee51d79a Mon Sep 17 00:00:00 2001 From: Takahiro Ebato Date: Tue, 10 Dec 2024 23:00:54 +0900 Subject: [PATCH] Make watch command require tasks argument --- 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 {