From 00ca55dd059ecd5b35224e867f1c59c09cb2c11f Mon Sep 17 00:00:00 2001 From: SataQiu Date: Mon, 1 Mar 2021 23:16:47 +0800 Subject: [PATCH] fix the bug that hack/update-vendor.sh exits with error but no indication of failure --- hack/update-vendor.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hack/update-vendor.sh b/hack/update-vendor.sh index 0f5acdebf05..67e0dee64bd 100755 --- a/hack/update-vendor.sh +++ b/hack/update-vendor.sh @@ -44,6 +44,15 @@ TMP_DIR="${TMP_DIR:-$(mktemp -d /tmp/update-vendor.XXXX)}" LOG_FILE="${LOG_FILE:-${TMP_DIR}/update-vendor.log}" kube::log::status "logfile at ${LOG_FILE}" +function finish { + ret=$? + if [[ ${ret} != 0 ]]; then + echo "An error has occurred. Please see more details in ${LOG_FILE}" + fi + exit ${ret} +} +trap finish EXIT + if [ -z "${BASH_XTRACEFD:-}" ]; then exec 19> "${LOG_FILE}" export BASH_XTRACEFD="19"