build_helper: add EXIT handler to inform that the build fails

This commit is contained in:
Frédéric Leroy
2016-06-24 06:09:51 -05:00
parent 30cf26c0dc
commit a3d26040de
+12
View File
@@ -95,6 +95,18 @@ check_supported_distribution() {
return 1
}
##################
# Error handlers #
##################
handler_EXIT() {
local exit_code=$?
[ "$exit_code" -eq 0 ] || echo_error "build have failed"
exit $exit_code
}
trap handler_EXIT EXIT
###########################
# Cleaners
###########################