registry/install-commit-hook

21 lines
263 B
Plaintext
Raw Normal View History

2017-10-25 22:23:52 +02:00
#!/bin/sh
if [ $# -eq 0 ]
then
echo "Usage: $0 YOUR-MNT"
exit
fi
BASE="$(realpath "$0")"
BASE="$(dirname "$BASE")"
cd "$BASE" || exit 1
2017-10-25 23:23:34 +02:00
cat > .git/hooks/pre-commit <<EOF
2017-10-25 22:23:52 +02:00
#!/bin/sh
2017-10-25 23:23:34 +02:00
./check-my-stuff "$1" || exit 1
2017-10-25 22:23:52 +02:00
EOF
chmod +x .git/hooks/pre-commit