diff --git a/lib/cli.js b/lib/cli.js index f2c6f761..15e91372 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -27,8 +27,6 @@ const executeCommand = (command, args = [], env = process.env) => { const main = async () => { try { - const state = createState(); - const {cliAnswers, cliOptions, passThroughParams} = parseArgs(); if (cliOptions.dryRun) { @@ -36,7 +34,7 @@ const main = async () => { console.log('Running in dry mode.'); } - const state = createState({disableEmoji: cliOptions['disable-emoji']}); + const state = createState({disableEmoji: cliOptions.disableEmoji}); if (cliOptions.nonInteractive) { await runNonInteractiveMode(state, cliAnswers); diff --git a/lib/parseArgs.js b/lib/parseArgs.js index 3d2964cb..e703aedd 100644 --- a/lib/parseArgs.js +++ b/lib/parseArgs.js @@ -12,6 +12,7 @@ const helpScreen = ` options: -h, --help show usage information -v, --version print version info and exit + --disable-emoji don't add emoji to commit title --non-interactive run git-cz in non-interactive mode non-interactive mode options: @@ -30,6 +31,7 @@ const parseArgs = () => { _: inputs, 'dry-run': dryRun, hook, + 'disable-emoji': disableEmoji, 'non-interactive': nonInteractive, body, breaking, @@ -48,7 +50,7 @@ const parseArgs = () => { h: 'help', v: 'version' }, - boolean: ['version', 'help', 'non-interactive', 'hook', 'dry-run'], + boolean: ['version', 'help', 'disable-emoji', 'non-interactive', 'hook', 'dry-run'], string: ['type', 'subject', 'scope', 'body', 'breaking', 'issues', 'learna'] }); @@ -63,6 +65,7 @@ const parseArgs = () => { } const cliOptions = { + disableEmoji, dryRun, help, hook,