huellas/hooks/install.sh
Felipe Contreras Salinas 9d5680e133
chore: add git hooks (#35)
Reviewed-on: #35
Co-authored-by: Felipe Contreras Salinas <felipe@bstr.cl>
Co-committed-by: Felipe Contreras Salinas <felipe@bstr.cl>
2023-11-18 21:39:42 -03:00

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