From cdf142cb8bbdc2186c04be31a443e79a377565d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gra=C3=A7a?= Date: Mon, 7 Dec 2020 22:13:50 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20move=20check=20for=20git?= =?UTF-8?q?=20folder=20to=20top?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the command was issued on a non git folder the "git diff" command would run first and output the help page because it wasnt recognized because it was not a git repo folder --- lib/cli.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 511e087f..d8b32e28 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -29,6 +29,14 @@ const main = async () => { try { const {cliAnswers, cliOptions, passThroughParams} = parseArgs(); + let state = null; + + if (cliOptions.disableEmoji) { + state = createState({disableEmoji: cliOptions.disableEmoji}); + } else { + state = createState(); + } + if (cliOptions.dryRun) { // eslint-disable-next-line no-console console.log('Running in dry mode.'); @@ -56,14 +64,6 @@ const main = async () => { } } - let state = null; - - if (cliOptions.disableEmoji) { - state = createState({disableEmoji: cliOptions.disableEmoji}); - } else { - state = createState(); - } - if (cliOptions.nonInteractive) { await runNonInteractiveMode(state, cliAnswers); } else {