#! /usr/bin/env sh | |
#git config --add hook.pre-commit.command `realpath | |
dir=`realpath $(dirname "$BASH_SOURCE:-0")` | |
# Space separated list of hooks to install | |
declare -a HOOKS=("pre-commit" "commit-msg") | |
for hook in ${HOOKS[@]}; do | |
if [ ! -f "${dir}/${hook}" ]; then | |
continue | |
fi | |
git config --add hook.${hook}.command "${dir}/${hook}" | |
git list hook "${hook}" | |
done |