Skip to content

Commit

Permalink
fix: using --debug option enables debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
iiroj committed Jan 2, 2022
1 parent a230b03 commit 5cceeb6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bin/lint-staged.js
Expand Up @@ -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)

/**
Expand All @@ -68,8 +71,6 @@ const getMaxArgLength = () => {
}
}

const cmdlineOptions = cmdline.opts()

const options = {
allowEmpty: !!cmdlineOptions.allowEmpty,
concurrent: JSON.parse(cmdlineOptions.concurrent),
Expand Down

0 comments on commit 5cceeb6

Please sign in to comment.