summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/functions2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/functions b/scripts/functions
index e47b286..c07c336 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -5,6 +5,8 @@
# Prepare the fault handler
CT_OnError() {
ret=$?
+ # Bail out early in subshell, the upper level shell will act accordingly.
+ [ ${BASH_SUBSHELL} -eq 0 ] || exit $ret
CT_DoLog ERROR "Build failed in step '${CT_STEP_MESSAGE[${CT_STEP_COUNT}]}'"
for((step=(CT_STEP_COUNT-1); step>1; step--)); do
CT_DoLog ERROR " called in step '${CT_STEP_MESSAGE[${step}]}'"