Skip to content

Commit 6d21374

Browse files
authored
Merge pull request #424 from viviedu/build-argv
Pass build options in argv style as well
2 parents 3c154c1 + 327574c commit 6d21374

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/targets/cordova/utils/parse-build-flags.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,18 @@ const ANDROID_OPTS = [
3333
];
3434

3535
module.exports = function(platform, options) {
36-
let buildKeys;
36+
let platformKeys = [];
3737

3838
if (platform === 'ios') {
39-
buildKeys = CORDOVA_OPTS.concat(IOS_OPTS);
39+
platformKeys = IOS_OPTS;
4040
} else if (platform === 'android') {
41-
buildKeys = CORDOVA_OPTS.concat(ANDROID_OPTS);
41+
platformKeys = ANDROID_OPTS;
4242
}
4343

44-
return _pick(options, buildKeys);
44+
let ret = _pick(options, CORDOVA_OPTS.concat(platformKeys));
45+
ret.argv = [].concat(...platformKeys
46+
.filter((key) => options.hasOwnProperty(key))
47+
.map((key) => [`--${key}`, options[key]]));
48+
49+
return ret;
4550
};

0 commit comments

Comments
 (0)