Give the list of hooks a chance to be configurable

This commit is contained in:
Pierre Pronchery 2020-02-24 05:57:10 +01:00
parent 7ca82023a4
commit 5b79f35ec4

View File

@ -28,6 +28,7 @@
GIT_GITWEB="https://git.defora.org/gitweb" GIT_GITWEB="https://git.defora.org/gitweb"
GIT_MIRROR="/home/defora/git" GIT_MIRROR="/home/defora/git"
GIT_REMOTE="origin" GIT_REMOTE="origin"
HOOKS="mirror irc"
IRC_CHANNEL="#DeforaOS" IRC_CHANNEL="#DeforaOS"
IRC_SERVER="irc.oftc.net" IRC_SERVER="irc.oftc.net"
PREFIX="/usr/local" PREFIX="/usr/local"
@ -90,9 +91,11 @@ while read line; do
echo "$line" >> "$tmpfile" echo "$line" >> "$tmpfile"
done done
#chain the hooks #chain the hooks
_hook_mirror < "$tmpfile" ret=0
_hook_irc < "$tmpfile" for hook in $HOOKS; do
"_hook_$hook" < "$tmpfile" || ret=2
done
#clean up #clean up
$RM -- "$tmpfile" || exit 2 $RM -- "$tmpfile" || exit 2
exit 0 exit $ret