diff --git a/index.js b/index.js index 7697945..6462883 100644 --- a/index.js +++ b/index.js @@ -241,21 +241,22 @@ function generateForConfig(imageObj, settings, config) { gauge.show(sectionName, 0); return Q.mapSeries(definitions, (def) => { - var transformPromise; + var transformPromise = Q.resolve(); + transformPromise = transformPromise.then(() => { + progressIndex++; + var progressRate = progressIndex / definitionCount; + gauge.show(sectionName, progressRate); + gauge.pulse(def.name); + }); switch (config.type) { case 'icon': - transformPromise = transformIcon(def); + transformPromise = transformPromise.then(() => transformIcon(def)); break; case 'splash': - transformPromise = transformSplash(def); + transformPromise = transformPromise.then(() => transformSplash(def)); break; } - return transformPromise.then(() => { - progressIndex++; - var progressRate = progressIndex / definitionCount; - gauge.show(sectionName, progressRate); - gauge.pulse(); - }); + return transformPromise; }).then(() => { gauge.disable(); display.success('Generated ' + config.type + ' files for ' + config.platform); diff --git a/package.json b/package.json index 30040b0..0f3fa77 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-res-generator", - "version": "0.4.0", + "version": "0.4.1", "description": "Generates icon & splash screen for cordova/ionic projects using javascript only.", "main": "index.js", "preferGlobal": true,