File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -1370,18 +1370,22 @@ class Asset extends MetadataType {
13701370 break ;
13711371 }
13721372 }
1373- const metadata = File . readJSONFile ( filePath , fileName , true , false ) ;
1374- const fileListNested = (
1375- await this . _mergeCode ( metadata , basePath , subType , metadata . customerKey )
1376- ) . map ( ( item ) =>
1377- File . normalizePath ( [
1378- basePath ,
1379- ...item . subFolder ,
1380- `${ item . fileName } .${ item . fileExt } ` ,
1381- ] )
1382- ) ;
1373+ if ( await File . pathExists ( File . normalizePath ( [ ...filePath , fileName ] ) ) ) {
1374+ const metadata = File . readJSONFile ( filePath , fileName , true , false ) ;
1375+ const fileListNested = (
1376+ await this . _mergeCode ( metadata , basePath , subType , metadata . customerKey )
1377+ ) . map ( ( item ) =>
1378+ File . normalizePath ( [
1379+ basePath ,
1380+ ...item . subFolder ,
1381+ `${ item . fileName } .${ item . fileExt } ` ,
1382+ ] )
1383+ ) ;
13831384
1384- return [ File . normalizePath ( [ ...filePath , fileName ] ) , ...fileListNested ] ;
1385+ return [ File . normalizePath ( [ ...filePath , fileName ] ) , ...fileListNested ] ;
1386+ } else {
1387+ return [ ] ;
1388+ }
13851389 } )
13861390 )
13871391 ) . flat ( ) ;
You can’t perform that action at this time.
0 commit comments