From 5cceeb65630752b646047ae88cacc48b76758f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iiro=20J=C3=A4ppinen?= Date: Sun, 2 Jan 2022 17:16:13 +0200 Subject: [PATCH] fix: using `--debug` option enables debug mode --- bin/lint-staged.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/lint-staged.js b/bin/lint-staged.js index 7b52b0899..1383a3933 100755 --- a/bin/lint-staged.js +++ b/bin/lint-staged.js @@ -44,10 +44,13 @@ cmdline ) .parse(process.argv) -const debugLog = debug('lint-staged:bin') -if (cmdline.debug) { +const cmdlineOptions = cmdline.opts() + +if (cmdlineOptions.debug) { debug.enable('lint-staged*') } + +const debugLog = debug('lint-staged:bin') debugLog('Running `lint-staged@%s`', version) /** @@ -68,8 +71,6 @@ const getMaxArgLength = () => { } } -const cmdlineOptions = cmdline.opts() - const options = { allowEmpty: !!cmdlineOptions.allowEmpty, concurrent: JSON.parse(cmdlineOptions.concurrent),