diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-03-13 22:44:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-14 02:44:16 +0000 |
commit | 9aa20b3ba758765863a4c1055097fda399efcfc3 (patch) | |
tree | 08ee8de378feb8037bbf609912939718620eaf08 /cli/tools/bench.rs | |
parent | 48ede89f1f192df28cc74822d7bb79b0b4bd0957 (diff) |
refactor: --watch commands use deno_core::resolve_url_or_path (#18172)
This commit changes various CLI subcommands that have support for
the "--watch" flag to use initial current working directory when
resolving "main module".
This is part of migration towards explicitly passing current working
directory to "deno_core::resolve_url_or_path" API.
As a side effect this makes "deno <subcommand> --watch" more aligned to
user expectations, where calling "Deno.chdir()" during program doesn't
break watcher.
Towards landing https://github.com/denoland/deno/pull/15454
Diffstat (limited to 'cli/tools/bench.rs')
-rw-r--r-- | cli/tools/bench.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/tools/bench.rs b/cli/tools/bench.rs index 70fc34ca1..0aa7cc365 100644 --- a/cli/tools/bench.rs +++ b/cli/tools/bench.rs @@ -691,10 +691,10 @@ pub async fn run_benchmarks_with_watch( ); if let Some(changed) = &changed { - for path in changed.iter().filter_map(|path| { - deno_core::resolve_url_or_path_deprecated(&path.to_string_lossy()) - .ok() - }) { + for path in changed + .iter() + .filter_map(|path| ModuleSpecifier::from_file_path(path).ok()) + { if modules.contains(&path) { modules_to_reload.push(specifier); break; |