Skip to content

Commit

Permalink
Fix ownerOfFile bug on windows
Browse files Browse the repository at this point in the history
#1762 only fixed the bug on unix. On windows the bug is still lurking.
  • Loading branch information
ef4 committed May 28, 2024
1 parent e8a0dd0 commit 08f0b4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/shared-internals/src/package-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ export default class PackageCache {

// first we look through our cached packages for any that are rooted right
// at or above the file.
for (let length = segments.length; length >= 0; length--) {
for (let length = segments.length; length > 0; length--) {
if (segments[length - 1] === 'node_modules' || segments[length - 1] === '') {
// once we hit a node_modules or the filesystem root, we're leaving the
// once we hit a node_modules, we're leaving the
// package we were in, so any higher caches don't apply to us
break;
}
Expand Down

0 comments on commit 08f0b4d

Please sign in to comment.