diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-06-15 13:09:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-15 13:09:37 -0400 |
commit | fa63fd4610fbe4a1d95c4da776e4a1cfa8f8e0b9 (patch) | |
tree | c23b95ed50ed20351b543c900cc970cd9e382ac1 /cli/tools/bundle.rs | |
parent | b2e546e530374ca9456aa3f6ff195c3384b32f24 (diff) |
refactor(flags): move watch flags into subcommand structs (#19516)
Moves the watch setting out of the `Flags` struct and into the
individual subcommands
Diffstat (limited to 'cli/tools/bundle.rs')
-rw-r--r-- | cli/tools/bundle.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/cli/tools/bundle.rs b/cli/tools/bundle.rs index 1800d03cc..dc944d646 100644 --- a/cli/tools/bundle.rs +++ b/cli/tools/bundle.rs @@ -28,13 +28,12 @@ pub async fn bundle( "Use alternative bundlers like \"deno_emit\", \"esbuild\" or \"rollup\" instead." ); - if flags.watch.is_some() { - let clear_screen = !flags.no_clear_screen; + if let Some(watch_flags) = &bundle_flags.watch { util::file_watcher::watch_func( flags, util::file_watcher::PrintConfig { job_name: "Bundle".to_string(), - clear_screen, + clear_screen: !watch_flags.no_clear_screen, }, move |flags, sender, _changed_paths| { let bundle_flags = bundle_flags.clone(); @@ -44,11 +43,7 @@ pub async fn bundle( .build_from_flags(flags) .await?; let cli_options = factory.cli_options(); - - if let Some(watch_paths) = cli_options.watch_paths() { - let _ = sender.send(watch_paths); - } - + let _ = sender.send(cli_options.watch_paths()); bundle_action(factory, &bundle_flags).await?; Ok(()) |