Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/cli/util/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ function enumerateFilesWorker(results: string[], dir: string, opts: EnumerateFil

if (entry.isDirectory()) {
enumerateFilesWorker(results, fullpath, opts);
} else if (entry.isSymbolicLink()) {
try {
const stats = fs.statSync(fullpath);
if (stats.isDirectory()) {
enumerateFilesWorker(results, fullpath, opts);
} else if (stats.isFile()) {
results.push(fullpath);
}
} catch (err) {
// Skip broken symlinks
continue;
}
} else {
results.push(fullpath);
}
Expand Down