pagure-new/pagure/hooks/files/pre-receive

24 lines
375 B
Text
Raw Permalink Normal View History

2016-09-21 23:21:07 +00:00
#!/bin/bash
#
# author: orefalo
hookname=`basename $0`
FILE=`mktemp`
trap 'rm -f $FILE' EXIT
cat - > $FILE
for hook in $GIT_DIR/hooks/$hookname.*
do
if test -x "$hook"; then
cat $FILE | $hook "$@"
status=$?
if test $status -ne 0; then
echo Hook $hook failed with error code $status
exit $status
fi
fi
done