make release hook more flexible

This commit is contained in:
dead-horse 2014-12-03 00:51:40 +08:00
parent fc726204e3
commit 9a9be49b63

View file

@ -2,9 +2,18 @@
hook() {
local hook=.git/hooks/$1.sh
# compat without extname
if test ! -f $hook; then
hook=.git/hooks/$1
fi
if test -f $hook; then
echo "... $1"
. $hook
if test -x $hook; then
$hook
else
. $hook
fi
fi
}