1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-19 12:16:17 -05:00

fix(compile/windows): better handling of deno_dir on different drive letter than code (#27654)

Closes https://github.com/denoland/deno/issues/27651
This commit is contained in:
David Sherret 2025-01-13 22:29:21 -05:00 committed by GitHub
parent 9dbb99a83c
commit 7616429436
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
{