setup.js 363 B

123456789101112
  1. const { test, ln, chmod } = require('shelljs')
  2. function installHooks () {
  3. if (test('-e', '.git/hooks')) {
  4. ln('-sf', '../../build/git-hooks/pre-commit', '.git/hooks/pre-commit')
  5. chmod('+x', '.git/hooks/pre-commit')
  6. ln('-sf', '../../build/git-hooks/commit-msg', '.git/hooks/commit-msg')
  7. chmod('+x', '.git/hooks/commit-msg')
  8. }
  9. }
  10. installHooks()