Skip to content

Commit

Permalink
fix(install): don't attempt to cache specifiers that point to directo…
Browse files Browse the repository at this point in the history
…ries (#26369)

Fixes #26162
  • Loading branch information
nathanwhit authored and bartlomieju committed Oct 17, 2024
1 parent c6492f6 commit 2c0cc4e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cli/tools/registry/pm/cache_deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ pub async fn cache_top_level_deps(
if entry.key.ends_with('/') && specifier.as_str().ends_with('/') {
continue;
}
if specifier.scheme() == "file" {
if let Ok(path) = specifier.to_file_path() {
if !path.is_file() {
continue;
}
}
}
roots.push(specifier.clone());
}
}
Expand Down
9 changes: 9 additions & 0 deletions tests/specs/install/import_map_with_dir/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"tempDir": true,
"steps": [
{
"args": "install",
"output": ""
}
]
}
5 changes: 5 additions & 0 deletions tests/specs/install/import_map_with_dir/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"imports": {
"@assets": "./src/assets/"
}
}

0 comments on commit 2c0cc4e

Please sign in to comment.