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:
parent
9dbb99a83c
commit
7616429436
1 changed files with 10 additions and 2 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue