simple-git-hooks
Version:
A simple, zero dependency tool for setting up git hooks for small projects
15 lines (10 loc) • 539 B
JavaScript
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
}
setHooksFromConfig(process.cwd(), process.argv)
.then(() => console.log('[INFO] Successfully set all git hooks'))
.catch(e => console.log('[ERROR], Was not able to set git hooks. Error: ' + e))