Skip to content

Commit

Permalink
feat: support SKIP_INSTALL_SIMPLE_GIT_HOOKS env
Browse files Browse the repository at this point in the history
close #99
  • Loading branch information
JounQin committed Mar 11, 2024
1 parent 1bb083d commit 50c51a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
*/
const {setHooksFromConfig} = require('./simple-git-hooks')

const {SKIP_INSTALL_SIMPLE_GIT_HOOKS} = process.env

if (['1', 'true'].includes(SKIP_INSTALL_SIMPLE_GIT_HOOKS)) {
console.log(`[INFO] SKIP_INSTALL_SIMPLE_GIT_HOOKS is set to "${SKIP_INSTALL_SIMPLE_GIT_HOOKS}", skipping installing hook.`)
return
}

try {
setHooksFromConfig(process.cwd(), process.argv)
console.log('[INFO] Successfully set all git hooks')
Expand Down

0 comments on commit 50c51a1

Please sign in to comment.