libreoffice-online/scripts/refresh-git-hooks
Miklos Vajna 9619517a10 git hooks: enable them automatically during 'make'
So one can't forget enabling them.

Change-Id: Icb595e9d0711227eaa6f11c1a9ff87f2c361e0bb
2020-10-07 12:54:47 +02:00

21 lines
392 B
Bash
Executable file

#!/bin/bash -e
srcdir="$PWD"
if [ -n "${abs_srcdir}" ]; then
srcdir="${abs_srcdir}"
fi
if [ ! -d "${srcdir}/.git" ]; then
exit 0
fi
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: