@@ -106,10 +106,6 @@ export class ProjectDataService implements IProjectDataService {
106
106
const basePath = hasMigrated ? path . join ( pathToAndroidDir , SRC_DIR , MAIN_DIR , RESOURCES_DIR ) : pathToAndroidDir ;
107
107
108
108
const currentStructure = this . $fs . enumerateFilesInDirectorySync ( basePath ) ;
109
- // , (file: string, stat: IFsStats) => {
110
- // return stat.isDirectory() || file.indexOf("drawable") !== -1;
111
- // });
112
-
113
109
const content = this . getImageDefinitions ( ) . android ;
114
110
115
111
return {
@@ -167,20 +163,20 @@ export class ProjectDataService implements IProjectDataService {
167
163
return content ;
168
164
}
169
165
170
- private getAndroidAssetSubGroup ( input : any , realPaths : string [ ] ) : IAssetSubGroup {
166
+ private getAndroidAssetSubGroup ( assetItems : IAssetItem [ ] , realPaths : string [ ] ) : IAssetSubGroup {
171
167
const assetSubGroup : IAssetSubGroup = {
172
168
images : < any > [ ]
173
169
} ;
174
170
175
171
const normalizedPaths = _ . map ( realPaths , p => path . normalize ( p ) ) ;
176
- _ . each ( input , image => {
177
- _ . find ( normalizedPaths , currentNormalizedPath => {
178
- const imagePath = path . join ( image . directory , image . filename ) ;
172
+ _ . each ( assetItems , assetItem => {
173
+ _ . each ( normalizedPaths , currentNormalizedPath => {
174
+ const imagePath = path . join ( assetItem . directory , assetItem . filename ) ;
179
175
if ( currentNormalizedPath . indexOf ( path . normalize ( imagePath ) ) !== - 1 ) {
180
- image . path = currentNormalizedPath ;
181
- image . size = `${ image . width } ${ AssetConstants . sizeDelimiter } ${ image . height } ` ;
182
- assetSubGroup . images . push ( image ) ;
183
- return true ;
176
+ assetItem . path = currentNormalizedPath ;
177
+ assetItem . size = `${ assetItem . width } ${ AssetConstants . sizeDelimiter } ${ assetItem . height } ` ;
178
+ assetSubGroup . images . push ( assetItem ) ;
179
+ return false ;
184
180
}
185
181
} ) ;
186
182
} ) ;
0 commit comments