Skip to content

Commit 94b8e4e

Browse files
committed
fix(init): init with multiple platforms, fixes #612
1 parent 53996f8 commit 94b8e4e

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

lib/commands/init.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ const logger = require('../utils/logger');
66
const fsUtils = require('../utils/fs-utils');
77
const getOS = require('../utils/get-os');
88
const getVersions = require('../utils/get-versions');
9-
const RSVP = require('rsvp');
10-
const Promise = RSVP.Promise;
9+
const Promise = require('rsvp').Promise;
1110
const lodash = require('lodash');
1211
const _get = lodash.get;
1312
const _pick = lodash.pick;
@@ -90,18 +89,17 @@ module.exports = Command.extend({
9089
},
9190

9291
installPlatforms(platforms, options) {
93-
let installs = [];
9492
let installOpts = _pick(options, 'crosswalk', 'uiwebview');
9593
installOpts.save = true;
9694

9795
let addPlatform = new PlatformTask({ project: this.project });
9896

99-
platforms.forEach((platform) => {
100-
logger.info(`Installing platform '${platform}'...`);
101-
installs.push(addPlatform.run('add', platform, installOpts));
102-
});
103-
104-
return RSVP.allSettled(installs);
97+
if (platforms.length === 1) {
98+
return addPlatform.run('add', platforms[0], installOpts);
99+
} else if (platforms.length === 2) {
100+
return addPlatform.run('add', platforms[0], installOpts)
101+
.then(() => { addPlatform.run('add', platforms[1], installOpts) });
102+
}
105103
},
106104

107105
run(opts = {}) {

0 commit comments

Comments
 (0)