diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-10-19 07:05:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-19 07:05:00 +0200 |
commit | 8d9fef3b8955eadfd4820455b422b5bec1cdad0a (patch) | |
tree | 7114c3e3c329c83ce1d9c90e8fab5c7104bd1579 /cli/tools/bundle.rs | |
parent | 5095af78018f1d77374bc06cbb58231e631056b9 (diff) |
refactor: add WatcherCommunicator helper struct (#20927)
This commit introduces "WatcherCommunicator" struct that
is used facilitate bi-directional communication between CLI
file watcher and the watched function.
Prerequisite for https://github.com/denoland/deno/pull/20876
Diffstat (limited to 'cli/tools/bundle.rs')
-rw-r--r-- | cli/tools/bundle.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cli/tools/bundle.rs b/cli/tools/bundle.rs index 827641b1b..cbde8768f 100644 --- a/cli/tools/bundle.rs +++ b/cli/tools/bundle.rs @@ -35,15 +35,14 @@ pub async fn bundle( job_name: "Bundle".to_string(), clear_screen: !watch_flags.no_clear_screen, }, - move |flags, sender, _changed_paths| { + move |flags, watcher_communicator, _changed_paths| { let bundle_flags = bundle_flags.clone(); Ok(async move { let factory = CliFactoryBuilder::new() - .with_watcher(sender.clone()) - .build_from_flags(flags) + .build_from_flags_for_watcher(flags, watcher_communicator.clone()) .await?; let cli_options = factory.cli_options(); - let _ = sender.send(cli_options.watch_paths()); + let _ = watcher_communicator.watch_paths(cli_options.watch_paths()); bundle_action(factory, &bundle_flags).await?; Ok(()) |