summaryrefslogtreecommitdiff
path: root/data/install-git-hook.sh
blob: 355867bdf86732f2a1b138a080de9873e3ce41c6 (plain)
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"