You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
508 B
34 lines
508 B
#!/bin/sh
|
|
#
|
|
# A generic git hook proxy.
|
|
# https://git-scm.com/docs/githooks
|
|
|
|
run() {
|
|
hook=$1
|
|
file=$2
|
|
|
|
n=$(echo "${file}" |sed "s/^.*${hook}\.//")
|
|
echo "running ${n} ${hook}"
|
|
${file}
|
|
}
|
|
|
|
die() {
|
|
hook=$1
|
|
echo "${hook} hook did not succeed" >&2
|
|
exit 1
|
|
}
|
|
|
|
# Redirect output to stderr.
|
|
exec 1>&2
|
|
|
|
githooks='.githooks'
|
|
basename=$(basename "$0")
|
|
|
|
for f in $(cd ${githooks} && echo *); do
|
|
case "${f}" in
|
|
${basename}.*)
|
|
run ${basename} "${githooks}/${f}" || die "${f}"
|
|
;;
|
|
esac
|
|
done
|