fix(package): update yargs to version 12.0.0
This commit is contained in:
parent
4454d57e02
commit
d4f68a5680
16
cli.js
16
cli.js
@ -1,5 +1,3 @@
|
|||||||
const {pickBy, isUndefined} = require('lodash');
|
|
||||||
|
|
||||||
const stringList = {
|
const stringList = {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
array: true,
|
array: true,
|
||||||
@ -13,6 +11,7 @@ module.exports = async () => {
|
|||||||
const cli = require('yargs')
|
const cli = require('yargs')
|
||||||
.command('$0', 'Run automated package publishing', yargs => {
|
.command('$0', 'Run automated package publishing', yargs => {
|
||||||
yargs.demandCommand(0, 0).usage(`Run automated package publishing
|
yargs.demandCommand(0, 0).usage(`Run automated package publishing
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
semantic-release [options] [plugins]`);
|
semantic-release [options] [plugins]`);
|
||||||
})
|
})
|
||||||
@ -20,7 +19,7 @@ Usage:
|
|||||||
.option('r', {alias: 'repository-url', describe: 'Git repository URL', type: 'string', group: 'Options'})
|
.option('r', {alias: 'repository-url', describe: 'Git repository URL', type: 'string', group: 'Options'})
|
||||||
.option('t', {alias: 'tag-format', describe: 'Git tag format', type: 'string', group: 'Options'})
|
.option('t', {alias: 'tag-format', describe: 'Git tag format', type: 'string', group: 'Options'})
|
||||||
.option('e', {alias: 'extends', describe: 'Shareable configurations', ...stringList, group: 'Options'})
|
.option('e', {alias: 'extends', describe: 'Shareable configurations', ...stringList, group: 'Options'})
|
||||||
.option('ci', {describe: 'Toggle CI verifications', default: undefined, type: 'boolean', group: 'Options'})
|
.option('ci', {describe: 'Toggle CI verifications', type: 'boolean', group: 'Options'})
|
||||||
.option('verify-conditions', {...stringList, group: 'Plugins'})
|
.option('verify-conditions', {...stringList, group: 'Plugins'})
|
||||||
.option('analyze-commits', {type: 'string', group: 'Plugins'})
|
.option('analyze-commits', {type: 'string', group: 'Plugins'})
|
||||||
.option('verify-release', {...stringList, group: 'Plugins'})
|
.option('verify-release', {...stringList, group: 'Plugins'})
|
||||||
@ -29,16 +28,15 @@ Usage:
|
|||||||
.option('publish', {...stringList, group: 'Plugins'})
|
.option('publish', {...stringList, group: 'Plugins'})
|
||||||
.option('success', {...stringList, group: 'Plugins'})
|
.option('success', {...stringList, group: 'Plugins'})
|
||||||
.option('fail', {...stringList, group: 'Plugins'})
|
.option('fail', {...stringList, group: 'Plugins'})
|
||||||
.option('debug', {describe: 'Output debugging information', default: undefined, type: 'boolean', group: 'Options'})
|
.option('debug', {describe: 'Output debugging information', type: 'boolean', group: 'Options'})
|
||||||
.option('d', {alias: 'dry-run', describe: 'Skip publishing', default: undefined, type: 'boolean', group: 'Options'})
|
.option('d', {alias: 'dry-run', describe: 'Skip publishing', type: 'boolean', group: 'Options'})
|
||||||
.option('h', {alias: 'help', default: undefined, group: 'Options'})
|
.option('h', {alias: 'help', group: 'Options'})
|
||||||
.option('v', {alias: 'version', default: undefined, group: 'Options'})
|
.option('v', {alias: 'version', group: 'Options'})
|
||||||
.strict(false)
|
.strict(false)
|
||||||
.exitProcess(false);
|
.exitProcess(false);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Remove option with undefined values, as yargs sets non defined options as `undefined`
|
const {help, version, ...opts} = cli.argv;
|
||||||
const {help, version, ...opts} = pickBy(cli.argv, value => !isUndefined(value));
|
|
||||||
|
|
||||||
if (Boolean(help) || Boolean(version)) {
|
if (Boolean(help) || Boolean(version)) {
|
||||||
process.exitCode = 0;
|
process.exitCode = 0;
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
"read-pkg-up": "^4.0.0",
|
"read-pkg-up": "^4.0.0",
|
||||||
"resolve-from": "^4.0.0",
|
"resolve-from": "^4.0.0",
|
||||||
"semver": "^5.4.1",
|
"semver": "^5.4.1",
|
||||||
"yargs": "^11.0.0"
|
"yargs": "^12.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ava": "^0.25.0",
|
"ava": "^0.25.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user