libreoffice-online/scripts/refresh-git-hooks
Gleb Popov fed8ed59a4 Use portable /usr/bin/env bash shebang, instead of /bin/bash one.
Signed-off-by: Gleb Popov <6yearold@gmail.com>
Change-Id: I196c8747d9c88991bd0352849113748f8ea1294d
2020-12-17 11:52:18 +00:00

23 lines
405 B
Bash
Executable file

#!/usr/bin/env bash
set -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: