diff options
author | Yazan AbdAl-Rahman <yazan.abdalrahman@exalt.ps> | 2024-09-18 16:51:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-18 14:51:39 +0100 |
commit | bed46474b2d59b229bd85dbdec5b3d943c32f60f (patch) | |
tree | 8262166530242f7c1b68de17e97c646912f1b939 /cli/args/flags.rs | |
parent | 48ea4e3c92b53936e89101a56a013300a47337d3 (diff) |
fix: do not panic running invalid file specifier (#25530)
Co-authored-by: Bedis Nbiba <bedisnbiba@gmail.com>
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r-- | cli/args/flags.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 92336a0a1..da07c16d8 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -34,6 +34,7 @@ use deno_core::url::Url; use deno_graph::GraphKind; use deno_runtime::deno_permissions::parse_sys_kind; use deno_runtime::deno_permissions::PermissionsOptions; +use deno_runtime::fs_util::specifier_to_file_path; use log::debug; use log::Level; use serde::Deserialize; @@ -918,7 +919,7 @@ impl Flags { if module_specifier.scheme() == "file" || module_specifier.scheme() == "npm" { - if let Ok(p) = module_specifier.to_file_path() { + if let Ok(p) = specifier_to_file_path(&module_specifier) { Some(vec![p.parent().unwrap().to_path_buf()]) } else { Some(vec![current_dir.to_path_buf()]) |