diff --git a/index.js b/index.js index 2dc64d8..8106963 100755 --- a/index.js +++ b/index.js @@ -217,7 +217,7 @@ async function main() { } const defaultBase = getConfigOption(ymlConfig, 'prs.main-branch-name') || DEFAULT_BASE_BRANCH; - const draftByDefault = getConfigOption(ymlConfig, 'prs.draft-by-default'); + const draftByDefault = !!getConfigOption(ymlConfig, 'prs.draft-by-default'); program .version(package.version) @@ -228,13 +228,10 @@ async function main() { .option('-f, --force', 'Force push to remote') .option('--push-merged', 'Push all branches (including those that have already been merged into the base branch)') .option('--remote ', 'Set remote to push to. Defaults to "origin"') - .option('-b, --base ', `Specify the base branch to use for the first and combined PRs.`, defaultBase); - if (draftByDefault) { - program.option('--no-draft', 'Do not create PRs in draft mode (override default)'); - } else { - program.option('-d, --draft', 'Create PRs in draft mode') - } - program.option('-c, --create-prs', 'Create GitHub PRs from your train branches'); + .option('-b, --base ', `Specify the base branch to use for the first and combined PRs.`, defaultBase) + .option('-d, --draft', 'Create PRs in draft mode', draftByDefault) + .option('--no-draft', 'Do not create PRs in draft mode', !draftByDefault) + .option('-c, --create-prs', 'Create GitHub PRs from your train branches'); program.on('--help', () => { console.log(''); diff --git a/package-lock.json b/package-lock.json index 824361a..2bb20b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -170,9 +170,9 @@ } }, "commander": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.0.tgz", - "integrity": "sha512-7B1ilBwtYSbetCgTY1NJFg+gVpestg0fdA1MhC1Vs4ssyfSXnCAjFr+QcQM9/RedXC0EaUx1sG8Smgw2VfgKEg==" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==" }, "concat-map": { "version": "0.0.1", diff --git a/package.json b/package.json index cb656ac..40a39c2 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "colors": "^1.2.1", - "commander": "^2.15.0", + "commander": "^3.0.2", "figlet": "^1.2.0", "inquirer": "^6.2.1", "js-yaml": "^3.13.1",