Ensure that errexit is honoured in hooks

Partial fix for #7524.
This commit is contained in:
Eelco Dolstra 2015-05-12 18:41:02 +02:00
parent 6671bb8be4
commit 9ae86dc3fc

View File

@ -19,7 +19,7 @@ runHook() {
if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi
eval "local -a dummy=(\"\${$var[@]}\")"
for hook in "_callImplicitHook 0 $hookName" "${dummy[@]}"; do
if ! _eval "$hook" "$@"; then return 1; fi
_eval "$hook" "$@"
done
return 0
}