diff --git a/lib/index.js b/lib/index.js index 2fdf03bb4..acd2e66c2 100644 --- a/lib/index.js +++ b/lib/index.js @@ -337,10 +337,10 @@ NwBuilder.prototype.preparePlatformSpecificManifests = function(){ } var self = this; + var promises = []; - return new Promise(function(resolve, reject){ - self._forEachPlatform(function (name, platform) { - + self._forEachPlatform(function (name, platform) { + promises.push(new Promise(function(resolve, reject){ var overrides = self._appPkg.platformOverrides; if (overrides[name] || overrides[name.substr(0, name.length-2)]) { @@ -355,9 +355,13 @@ NwBuilder.prototype.preparePlatformSpecificManifests = function(){ platform.platformSpecificManifest = result; resolve(); }); + } else { + resolve(); } - }); - }) + })); + }); + + return Promise.all(promises); };