From 63dcbd6c0336cc7677512ebdcff875f85c7a6394 Mon Sep 17 00:00:00 2001
From: Lukas Werner <lks.werner@fau.de>
Date: Thu, 5 Aug 2021 16:46:02 +0200
Subject: [PATCH] Added error function to config.sh

---
 runner_scripts/root/config.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/runner_scripts/root/config.sh b/runner_scripts/root/config.sh
index 4458a02..0145bde 100755
--- a/runner_scripts/root/config.sh
+++ b/runner_scripts/root/config.sh
@@ -8,6 +8,12 @@ TXT_GREEN="\e[32m"
 TXT_CLEAR="\e[0m"
 TXT_BOLD="\e[1m"
 
+function error {
+    : "${RV:=${2:-$BUILD_FAILURE_EXIT_CODE}}"
+    echo -e "${TXT_RED}${TXT_BOLD}$1${TXT_CLEAR}" >&2
+    return "$RV"
+}
+
 [ -z "${CUSTOM_ENV_AUTH_USER:+x}" ] && error "AUTH_USER CI/CD variable has not been set."
 [ -z "${CUSTOM_ENV_AUTH_KEY:+x}" ] && error "AUTH_KEY secret CI/CD variable has not been set."
 
-- 
GitLab