From 4fa1730cdd8657c2f9cb069b0efd9cecbbbb2d7c Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Sat, 26 Oct 2024 04:34:00 +0200 Subject: [PATCH] ci: only end current section if there is a current section Part-of: --- .gitlab-ci/setup-test-env.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci/setup-test-env.sh b/.gitlab-ci/setup-test-env.sh index a150bcaff92..dfce99ef3ea 100644 --- a/.gitlab-ci/setup-test-env.sh +++ b/.gitlab-ci/setup-test-env.sh @@ -31,7 +31,9 @@ function error { RED="\e[0;31m" ENDCOLOR="\e[0m" # we force the following to be not in a section - _section_end $CURRENT_SECTION + if [ -n "${CURRENT_SECTION:-}" ]; then + _section_end $CURRENT_SECTION + fi CURR_MINSEC=$(get_current_minsec) echo -e "\n${RED}[${CURR_MINSEC}] ERROR: $*${ENDCOLOR}\n"