Skip to content

Commit

Permalink
fix: judge next dirent cache type (#15787)
Browse files Browse the repository at this point in the history
  • Loading branch information
XiSenao authored Feb 6, 2024
1 parent 37382d1 commit 5fbeba3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/fsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ export function createCachedFsUtils(config: ResolvedConfig): FsUtils {
return
}
if (nextDirentCache.type === 'directory_maybe_symlink') {
dirPath ??= pathUntilPart(root, parts, i)
dirPath ??= pathUntilPart(root, parts, i + 1)
const isSymlink = fs
.lstatSync(dirPath, { throwIfNoEntry: false })
?.isSymbolicLink()
direntCache.type = isSymlink ? 'symlink' : 'directory'
nextDirentCache.type = isSymlink ? 'symlink' : 'directory'
}
direntCache = nextDirentCache
} else if (direntCache.type === 'symlink') {
Expand Down

0 comments on commit 5fbeba3

Please sign in to comment.