setup_hooks.sh 469 B

123456789101112131415
  1. #!/bin/sh
  2. set -eu
  3. # This stops git rev-parse from failing if we run this from the .git directory
  4. builtin cd "$(dirname "${BASH_SOURCE:-$0}")"
  5. ROOT="$(git rev-parse --show-toplevel)"
  6. builtin cd "${ROOT}"
  7. # If we change the lint location we should modify the path of lint relative .git
  8. RELATIVE_PATH="../../ci/lint"
  9. ln -sf "${RELATIVE_PATH}/pre-push" "${ROOT}/.git/hooks/pre-push"
  10. ln -sf "${RELATIVE_PATH}/prepare-commit-msg" "${ROOT}/.git/hooks/prepare-commit-msg"