mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-24 05:41:13 +08:00
240258a3e5
* test -x is not enough https://stackoverflow.com/a/39489087
16 lines
324 B
Bash
16 lines
324 B
Bash
#!/usr/bin/env bash
|
|
data=$(cat)
|
|
exitcodes=""
|
|
hookname=$(basename $0)
|
|
GIT_DIR=${GIT_DIR:-$(dirname $0)}
|
|
|
|
for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do
|
|
test -x "${hook}" && test -f "${hook}" || continue
|
|
echo "${data}" | "${hook}"
|
|
exitcodes="${exitcodes} $?"
|
|
done
|
|
|
|
for i in ${exitcodes}; do
|
|
[ ${i} -eq 0 ] || exit ${i}
|
|
done
|