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