summaryrefslogtreecommitdiff
path: root/cli/tools
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools')
-rw-r--r--cli/tools/bench/mod.rs9
-rw-r--r--cli/tools/bundle.rs7
-rw-r--r--cli/tools/fmt.rs4
-rw-r--r--cli/tools/lint.rs4
-rw-r--r--cli/tools/run.rs7
-rw-r--r--cli/tools/test/mod.rs9
6 files changed, 18 insertions, 22 deletions
diff --git a/cli/tools/bench/mod.rs b/cli/tools/bench/mod.rs
index 454a97126..eb400442e 100644
--- a/cli/tools/bench/mod.rs
+++ b/cli/tools/bench/mod.rs
@@ -417,19 +417,18 @@ pub async fn run_benchmarks_with_watch(
.map(|w| !w.no_clear_screen)
.unwrap_or(true),
},
- move |flags, sender, changed_paths| {
+ move |flags, watcher_communicator, changed_paths| {
let bench_flags = bench_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 bench_options = cli_options.resolve_bench_options(bench_flags)?;
- let _ = sender.send(cli_options.watch_paths());
+ let _ = watcher_communicator.watch_paths(cli_options.watch_paths());
if let Some(include) = &bench_options.files.include {
- let _ = sender.send(include.clone());
+ let _ = watcher_communicator.watch_paths(include.clone());
}
let graph_kind = cli_options.type_check_mode().as_graph_kind();
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(())
diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs
index 284f20dda..b9525b7b2 100644
--- a/cli/tools/fmt.rs
+++ b/cli/tools/fmt.rs
@@ -68,7 +68,7 @@ pub async fn format(flags: Flags, fmt_flags: FmtFlags) -> Result<(), AnyError> {
job_name: "Fmt".to_string(),
clear_screen: !watch_flags.no_clear_screen,
},
- move |flags, sender, changed_paths| {
+ move |flags, watcher_communicator, changed_paths| {
let fmt_flags = fmt_flags.clone();
Ok(async move {
let factory = CliFactory::from_flags(flags).await?;
@@ -82,7 +82,7 @@ pub async fn format(flags: Flags, fmt_flags: FmtFlags) -> Result<(), AnyError> {
Ok(files)
}
})?;
- _ = sender.send(files.clone());
+ _ = watcher_communicator.watch_paths(files.clone());
let refmt_files = if let Some(paths) = changed_paths {
if fmt_options.check {
// check all files on any changed (https://github.com/denoland/deno/issues/12446)
diff --git a/cli/tools/lint.rs b/cli/tools/lint.rs
index 6a308b599..b7f4a3f0d 100644
--- a/cli/tools/lint.rs
+++ b/cli/tools/lint.rs
@@ -63,7 +63,7 @@ pub async fn lint(flags: Flags, lint_flags: LintFlags) -> Result<(), AnyError> {
job_name: "Lint".to_string(),
clear_screen: !watch_flags.no_clear_screen,
},
- move |flags, sender, changed_paths| {
+ move |flags, watcher_communicator, changed_paths| {
let lint_flags = lint_flags.clone();
Ok(async move {
let factory = CliFactory::from_flags(flags).await?;
@@ -77,7 +77,7 @@ pub async fn lint(flags: Flags, lint_flags: LintFlags) -> Result<(), AnyError> {
Ok(files)
}
})?;
- _ = sender.send(files.clone());
+ _ = watcher_communicator.watch_paths(files.clone());
let lint_paths = if let Some(paths) = changed_paths {
// lint all files on any changed (https://github.com/denoland/deno/issues/12446)
diff --git a/cli/tools/run.rs b/cli/tools/run.rs
index 5fb31a4ad..80e80577e 100644
--- a/cli/tools/run.rs
+++ b/cli/tools/run.rs
@@ -110,18 +110,17 @@ async fn run_with_watch(
job_name: "Process".to_string(),
clear_screen: !watch_flags.no_clear_screen,
},
- move |flags, sender, _changed_paths| {
+ move |flags, watcher_communicator, _changed_paths| {
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 main_module = cli_options.resolve_main_module()?;
maybe_npm_install(&factory).await?;
- let _ = sender.send(cli_options.watch_paths());
+ let _ = watcher_communicator.watch_paths(cli_options.watch_paths());
let permissions = PermissionsContainer::new(Permissions::from_options(
&cli_options.permissions_options(),
diff --git a/cli/tools/test/mod.rs b/cli/tools/test/mod.rs
index b3aadc1e7..8e29ba2cb 100644
--- a/cli/tools/test/mod.rs
+++ b/cli/tools/test/mod.rs
@@ -1213,19 +1213,18 @@ pub async fn run_tests_with_watch(
.map(|w| !w.no_clear_screen)
.unwrap_or(true),
},
- move |flags, sender, changed_paths| {
+ move |flags, watcher_communicator, changed_paths| {
let test_flags = test_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 test_options = cli_options.resolve_test_options(test_flags)?;
- let _ = sender.send(cli_options.watch_paths());
+ let _ = watcher_communicator.watch_paths(cli_options.watch_paths());
if let Some(include) = &test_options.files.include {
- let _ = sender.send(include.clone());
+ let _ = watcher_communicator.watch_paths(include.clone());
}
let graph_kind = cli_options.type_check_mode().as_graph_kind();