huellas/hooks/install.sh

11 lines
266 B
Bash
Executable file

#!/bin/bash
set -eu
if GIT_ROOT="$(git rev-parse --show-toplevel)"; then
ln -s $GIT_ROOT/hooks/pre-commit.sh $GIT_ROOT/.git/hooks/pre-commit
ln -s $GIT_ROOT/hooks/pre-push.sh $GIT_ROOT/.git/hooks/pre-push
else
echo "Failed to get git root, aborting"
exit 1
fi