diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 8e06d70274..02d30d055c 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -1006,7 +1006,7 @@ impl Flags { || module_specifier.scheme() == "npm" { if let Ok(p) = url_to_file_path(&module_specifier) { - Some(vec![p.parent().unwrap().to_path_buf()]) + p.parent().map(|parent| vec![parent.to_path_buf()]) } else { Some(vec![current_dir.to_path_buf()]) } diff --git a/tests/specs/run/with_double_slash/__test__.jsonc b/tests/specs/run/with_double_slash/__test__.jsonc new file mode 100644 index 0000000000..365db357cd --- /dev/null +++ b/tests/specs/run/with_double_slash/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run //", + "exitCode": 1, + "output": "error: [WILDCARD]" +}