install-hooks.js 306 B

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