fix: fix the --no-ci arg parsing

The `noCi` is no properly set based on the `--no-ci` CLI arg and it is overwritten by the `noCi` option
This commit is contained in:
Pierre Vanduynslager
2018-01-24 22:22:16 -08:00
committed by Gregor Martynus
parent 7e860c7915
commit 0d2d1f2376
4 changed files with 83 additions and 10 deletions
+4 -1
View File
@@ -48,8 +48,11 @@ module.exports = async () => {
program.outputHelp();
process.exitCode = 1;
} else {
const opts = program.opts();
// Set the `noCi` options as commander.js sets the `ci` options instead (becasue args starts with `--no`)
opts.noCi = opts.ci === false ? true : undefined;
// Remove option with undefined values, as commander.js sets non defined options as `undefined`
await require('.')(pickBy(program.opts(), value => !isUndefined(value)));
await require('.')(pickBy(opts, value => !isUndefined(value)));
}
} catch (err) {
process.exitCode = 1;