diff --git a/bin/ncu-ci b/bin/ncu-ci index 098f3c4b..725eec7f 100755 --- a/bin/ncu-ci +++ b/bin/ncu-ci @@ -23,6 +23,14 @@ const Request = require('../lib/request'); const CLI = require('../lib/cli'); const yargs = require('yargs'); +const optionKeys = [ + 'rate', + 'walk', + 'url', + 'pr', + 'commit', +] + // eslint-disable-next-line no-unused-vars const argv = yargs .command({ @@ -115,13 +123,20 @@ const argv = yargs default: false, describe: 'Write the results as markdown to clipboard' }) - .option('json', { + .option('json ', { type: 'string', - describe: 'Write the results as json to the path' + describe: 'Write the results as json to ' }) - .option('markdown', { + .option('markdown ', { type: 'string', - describe: 'Write the results as markdown to the path' + describe: 'Write the results as markdown to ' + }).check(argv => { + if (argv.markdown && optionKeys.includes(argv.markdown)) { + throw new Error('--markdown did not specify a valid path'); + } else if (argv.json && optionKeys.includes(argv.json)) { + throw new Error('--json did not specify a valid path'); + } + return true; }) .help() .argv;