2020-12-14 08:55:57 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
2020-10-07 04:59:20 -05:00
|
|
|
|
|
|
|
srcdir="$PWD"
|
|
|
|
if [ -n "${abs_srcdir}" ]; then
|
|
|
|
srcdir="${abs_srcdir}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "${srcdir}/.git" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2021-05-06 08:06:22 -05:00
|
|
|
mkdir -p ${srcdir}/.git/hooks
|
|
|
|
|
2020-10-07 04:59:20 -05:00
|
|
|
for hook_name in ${srcdir}/.git-hooks/*
|
|
|
|
do
|
|
|
|
hook="${srcdir}/.git/hooks/${hook_name##*/}"
|
|
|
|
if [ ! -e "${hook}" ]; then
|
|
|
|
rm -f "${hook}"
|
|
|
|
ln -sf "${hook_name}" "${hook}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# vim:set shiftwidth=4 softtabstop=4 expandtab:
|