telegram-bot-bash/dev/install-hooks.sh
Kay Marquardt (Gnadelwartz) 36d8604cde Bashbot Version 1.51
2021-06-03 14:21:40 +02:00

19 lines
458 B
Bash
Executable File

#!/usr/bin/env bash
# this has to run once atfer git clone
# and every time we create new hooks
#### $$VERSION$$ v1.51-0-g6e66a28
#shellcheck disable=SC1090
source "${0%/*}/dev.inc.sh"
printf "Installing hooks..."
for hook in pre-commit post-commit pre-push
do
rm -f "${GIT_DIR}/hooks/${hook}"
if [ -f "${HOOKDIR}/${hook}.sh" ]; then
printf "%s"" ${hook}"
ln -s "../../${HOOKDIR}/${hook}.sh" "${GIT_DIR}/hooks/${hook}"
fi
done
printf " Done!\n"