File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -419,14 +419,17 @@ module.exports = class PackageManager {
419419
420420 for ( const packageDirPath of this . packageDirPaths ) {
421421 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 ) {
425428 if (
426429 ! packageName . startsWith ( '.' ) &&
427- ! packagesByName . has ( packageName ) &&
428- fs . isDirectorySync ( packagePath )
430+ ! packagesByName . has ( packageName )
429431 ) {
432+ const packagePath = path . join ( packageDirPath , packageName ) ;
430433 packages . push ( {
431434 name : packageName ,
432435 path : packagePath ,
You can’t perform that action at this time.
0 commit comments