Skip to content

Commit 9ec7008

Browse files
authored
Merge pull request #71 from aminya/package_symbolic_link
2 parents 4f01cb1 + aca4629 commit 9ec7008

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/package-manager.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,16 @@ module.exports = class PackageManager {
419419

420420
for (const packageDirPath of this.packageDirPaths) {
421421
if (fs.isDirectorySync(packageDirPath)) {
422+
// checks for directories.
423+
// dirent is faster, but for checking symbolic link we need stat.
422424
const packageNames = fs
423425
.readdirSync(packageDirPath, { withFileTypes: true })
424-
.filter(dirent => dirent.isDirectory())
426+
.filter(
427+
dirent =>
428+
dirent.isDirectory() ||
429+
(dirent.isSymbolicLink() &&
430+
fs.isDirectorySync(path.join(packageDirPath, dirent.name)))
431+
)
425432
.map(dirent => dirent.name);
426433

427434
for (const packageName of packageNames) {

0 commit comments

Comments
 (0)