2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 01:49:48 +00:00
kea/tools/git-hooks-install
2019-12-13 18:38:25 +01:00

24 lines
543 B
Bash
Executable File

#!/bin/sh
# This script install user-side git commit hooks. You are supposed to run it
# only once for each repo (and very infrequently afterwards, once each time
# the git hooks change).
if test -d .git; then
TOPDIR=.
else
TOPDIR=..
fi
GITDIR=${TOPDIR}/.git
if test ! -d ${GITDIR}; then
echo "ERROR: Could not find ${GITDIR} in ${TOPDIR}"
exit -1
fi
echo "Installing hooks in ${GITDIR}/hooks"
mkdir -p ${GITDIR}/hooks
cp ${TOPDIR}/tools/git-hooks/prepare-commit-msg ${GITDIR}/hooks
chmod u+x ${GITDIR}/hooks/prepare-commit-msg