@@ -110,14 +110,12 @@ export class ResourcesCommand extends Command implements CommandPreRun {
110110 // check that config file config.xml exists
111111 const configJson = await parseConfigXmlToJson ( this . env . project . directory ) ;
112112
113- const config = await this . env . config . load ( ) ;
114-
115113 const resourceJsonStructure = await getResourceConfigJson ( ) ;
116- this . env . log . debug ( `resourceJsonStructure=${ Object . keys ( resourceJsonStructure ) . length } ` ) ;
114+ this . env . log . debug ( ( ) => `resourceJsonStructure=${ Object . keys ( resourceJsonStructure ) . length } ` ) ;
117115
118116 // check that at least one platform has been installed
119117 let platformDirContents = await getProjectPlatforms ( this . env . project . directory ) ;
120- this . env . log . debug ( `platformDirContents=${ platformDirContents } ` ) ;
118+ this . env . log . debug ( ( ) => `platformDirContents=${ platformDirContents } ` ) ;
121119
122120 if ( platform && ! platformDirContents . includes ( platform ) ) {
123121 this . env . tasks . end ( ) ;
@@ -130,19 +128,19 @@ export class ResourcesCommand extends Command implements CommandPreRun {
130128 if ( confirm ) {
131129 await installPlatform ( this . env , platform ) ;
132130 platformDirContents = await getProjectPlatforms ( this . env . project . directory ) ;
133- this . env . log . debug ( `platformDirContents=${ platformDirContents } ` ) ;
131+ this . env . log . debug ( ( ) => `platformDirContents=${ platformDirContents } ` ) ;
134132 } else {
135133 throw this . exit ( `Platform ${ chalk . green ( platform ) } not installed.` ) ;
136134 }
137135 }
138136
139137 const buildPlatforms = Object . keys ( resourceJsonStructure ) . filter ( p => platformDirContents . includes ( p ) ) ;
140- this . env . log . debug ( `buildPlatforms=${ buildPlatforms } ` ) ;
138+ this . env . log . debug ( ( ) => `buildPlatforms=${ buildPlatforms } ` ) ;
141139 if ( buildPlatforms . length === 0 ) {
142140 this . env . tasks . end ( ) ;
143141 throw this . exit ( `No platforms have been added. Please run: ${ chalk . green ( 'ionic cordova platform add' ) } ` ) ;
144142 }
145- this . env . log . debug ( `${ chalk . green ( 'getProjectPlatforms' ) } completed - length=${ buildPlatforms . length } ` ) ;
143+ this . env . log . debug ( ( ) => `${ chalk . green ( 'getProjectPlatforms' ) } completed - length=${ buildPlatforms . length } ` ) ;
146144
147145 const orientation = getOrientationFromConfigJson ( configJson ) || 'default' ;
148146
@@ -162,19 +160,19 @@ export class ResourcesCommand extends Command implements CommandPreRun {
162160 imgResources = imgResources . filter ( ( img ) => img . platform === platform ) ;
163161 }
164162
165- this . env . log . debug ( `imgResources=${ imgResources . length } ` ) ;
163+ this . env . log . debug ( ( ) => `imgResources=${ imgResources . length } ` ) ;
166164
167165 // Create the resource directories that are needed for the images we will create
168166 const buildDirResponses = await createImgDestinationDirectories ( imgResources ) ;
169- this . env . log . debug ( `${ chalk . green ( 'createImgDestinationDirectories' ) } completed - length=${ buildDirResponses . length } ` ) ;
167+ this . env . log . debug ( ( ) => `${ chalk . green ( 'createImgDestinationDirectories' ) } completed - length=${ buildDirResponses . length } ` ) ;
170168
171169 // Check /resources and /resources/<platform> directories for src files
172170 // Update imgResources to have their src attributes to equal the most
173171 // specific src img found
174172 let srcImagesAvailable : SourceImage [ ] = [ ] ;
175173 try {
176174 srcImagesAvailable = await getSourceImages ( buildPlatforms , resourceTypes , resourceDir ) ;
177- this . env . log . debug ( `${ chalk . green ( 'getSourceImages' ) } completed - ${ srcImagesAvailable . length } ` ) ;
175+ this . env . log . debug ( ( ) => `${ chalk . green ( 'getSourceImages' ) } completed - ${ srcImagesAvailable . length } ` ) ;
178176 } catch ( e ) {
179177
180178 }
@@ -214,7 +212,7 @@ export class ResourcesCommand extends Command implements CommandPreRun {
214212 let imageUploadResponses : ImageUploadResponse [ ] ;
215213
216214 imageUploadResponses = await uploadSourceImages ( srcImagesAvailable ) ;
217- this . env . log . debug ( `${ chalk . green ( 'uploadSourceImages' ) } completed - responses=${ JSON . stringify ( imageUploadResponses , null , 2 ) } ` ) ;
215+ this . env . log . debug ( ( ) => `${ chalk . green ( 'uploadSourceImages' ) } completed - responses=${ JSON . stringify ( imageUploadResponses , null , 2 ) } ` ) ;
218216
219217 srcImagesAvailable = srcImagesAvailable . map ( ( img : SourceImage , index ) : SourceImage => {
220218 return {
@@ -254,7 +252,7 @@ export class ResourcesCommand extends Command implements CommandPreRun {
254252
255253 const generateImageResponses = await Promise . all ( promiseList ) ;
256254 this . env . tasks . updateMsg ( `Generating platform resources: ${ chalk . bold ( `${ imgResources . length } / ${ imgResources . length } ` ) } complete` ) ;
257- this . env . log . debug ( `${ chalk . green ( 'generateResourceImage' ) } completed - responses=${ JSON . stringify ( generateImageResponses , null , 2 ) } ` ) ;
255+ this . env . log . debug ( ( ) => `${ chalk . green ( 'generateResourceImage' ) } completed - responses=${ JSON . stringify ( generateImageResponses , null , 2 ) } ` ) ;
258256
259257 // TODO: UPDATE CONFIG.XML DATA
260258 this . env . tasks . next ( `Modifying config.xml to add new image resources` ) ;
0 commit comments