Skip to content

Commit

Permalink
fix(compile/windows): better handling of deno_dir on different drive …
Browse files Browse the repository at this point in the history
…letter than code (#27654)

Closes #27651
  • Loading branch information
dsherret authored Jan 14, 2025
1 parent 9dbb99a commit 7616429
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cli/standalone/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,16 @@ impl<'a> DenoCompileBinaryWriter<'a> {
// this is not as optimized as it could be
let mut last_name =
Cow::Borrowed(DENO_COMPILE_GLOBAL_NODE_MODULES_DIR_NAME);
for ancestor in parent.ancestors() {
let dir = vfs.get_dir_mut(ancestor).unwrap();
for ancestor in
parent.ancestors().map(Some).chain(std::iter::once(None))
{
let dir = if let Some(ancestor) = ancestor {
vfs.get_dir_mut(ancestor).unwrap()
} else if cfg!(windows) {
vfs.get_system_root_dir_mut()
} else {
break;
};
if let Ok(index) =
dir.entries.binary_search(&last_name, case_sensitivity)
{
Expand Down

0 comments on commit 7616429

Please sign in to comment.