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 1babf3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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--) {
if (segments[length - 1] === 'node_modules' || segments[length - 1] === '') {
// once we hit a node_modules or the filesystem root, we're leaving the
for (let length = segments.length; length > 0; length--) {
if (segments[length - 1] === 'node_modules') {
// 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 1babf3d

Please sign in to comment.