summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-06-15 13:09:37 -0400
committerGitHub <noreply@github.com>2023-06-15 13:09:37 -0400
commitfa63fd4610fbe4a1d95c4da776e4a1cfa8f8e0b9 (patch)
treec23b95ed50ed20351b543c900cc970cd9e382ac1 /cli/main.rs
parentb2e546e530374ca9456aa3f6ff195c3384b32f24 (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/main.rs')
-rw-r--r--cli/main.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/main.rs b/cli/main.rs
index 29ab9a390..70db8f147 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -82,7 +82,7 @@ fn spawn_subcommand<F: Future<Output = T> + 'static, T: SubcommandOutput>(
async fn run_subcommand(flags: Flags) -> Result<i32, AnyError> {
let handle = match flags.subcommand.clone() {
DenoSubcommand::Bench(bench_flags) => spawn_subcommand(async {
- if flags.watch.is_some() {
+ if bench_flags.watch.is_some() {
tools::bench::run_benchmarks_with_watch(flags, bench_flags).await
} else {
tools::bench::run_benchmarks(flags, bench_flags).await
@@ -153,7 +153,7 @@ async fn run_subcommand(flags: Flags) -> Result<i32, AnyError> {
if run_flags.is_stdin() {
tools::run::run_from_stdin(flags).await
} else {
- tools::run::run_script(flags).await
+ tools::run::run_script(flags, run_flags).await
}
}),
DenoSubcommand::Task(task_flags) => spawn_subcommand(async {
@@ -161,7 +161,7 @@ async fn run_subcommand(flags: Flags) -> Result<i32, AnyError> {
}),
DenoSubcommand::Test(test_flags) => {
spawn_subcommand(async {
- if let Some(ref coverage_dir) = flags.coverage_dir {
+ if let Some(ref coverage_dir) = test_flags.coverage_dir {
std::fs::create_dir_all(coverage_dir)
.with_context(|| format!("Failed creating: {coverage_dir}"))?;
// this is set in order to ensure spawned processes use the same
@@ -172,7 +172,7 @@ async fn run_subcommand(flags: Flags) -> Result<i32, AnyError> {
);
}
- if flags.watch.is_some() {
+ if test_flags.watch.is_some() {
tools::test::run_tests_with_watch(flags, test_flags).await
} else {
tools::test::run_tests(flags, test_flags).await