File: install-git-hook.sh

package info (click to toggle)
libproxy 0.5.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 728 kB
  • sloc: ansic: 3,455; sh: 228; python: 128; makefile: 37; cs: 18; perl: 6
file content (11 lines) | stat: -rw-r--r-- 317 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash

cd "$MESON_SOURCE_ROOT"

[ -d .git ] || exit 2 # not a git repo
[ ! -f .git/hooks/pre-commit ] || exit 2 # already installed

cp data/pre-commit-hook .git/hooks/pre-commit
cp data/canonicalize_filename.sh .git/hooks/canonicalize_filename.sh
chmod +x .git/hooks/pre-commit
echo "Activated pre-commit hook"