File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -419,14 +419,17 @@ module.exports = class PackageManager {
419
419
420
420
for ( const packageDirPath of this . packageDirPaths ) {
421
421
if ( fs . isDirectorySync ( packageDirPath ) ) {
422
- for ( let packagePath of fs . readdirSync ( packageDirPath ) ) {
423
- packagePath = path . join ( packageDirPath , packagePath ) ;
424
- const packageName = path . basename ( packagePath ) ;
422
+ const packageNames = fs
423
+ . readdirSync ( packageDirPath , { withFileTypes : true } )
424
+ . filter ( dirent => dirent . isDirectory ( ) )
425
+ . map ( dirent => dirent . name ) ;
426
+
427
+ for ( const packageName of packageNames ) {
425
428
if (
426
429
! packageName . startsWith ( '.' ) &&
427
- ! packagesByName . has ( packageName ) &&
428
- fs . isDirectorySync ( packagePath )
430
+ ! packagesByName . has ( packageName )
429
431
) {
432
+ const packagePath = path . join ( packageDirPath , packageName ) ;
430
433
packages . push ( {
431
434
name : packageName ,
432
435
path : packagePath ,
You can’t perform that action at this time.
0 commit comments