Skip to content

Commit

Permalink
advise '--no-verify' does not skip post-* hooks (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
SKalt authored and typicode committed Sep 10, 2018
1 parent fe485d0 commit 9b1b34b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/runner/index.ts
Expand Up @@ -68,10 +68,14 @@ export default async function run(

return 0
} catch (err) {
const noVerifyMessage =
hookName === 'prepare-commit-msg'
? '(cannot be bypassed with --no-verify due to Git specs)'
: '(add --no-verify to bypass)'
const noVerifyMessage = [
'commit-msg',
'pre-commit',
'pre-rebase',
'pre-push'
].includes(hookName)
? '(add --no-verify to bypass)'
: '(cannot be bypassed with --no-verify due to Git specs)'

console.log(`husky > ${hookName} hook failed ${noVerifyMessage}`)
return err.code
Expand Down

0 comments on commit 9b1b34b

Please sign in to comment.