From 14d487f94bfede0b54cd04226c48b964db0e72fe Mon Sep 17 00:00:00 2001
From: Daniel van der Schuur <schuur@astron.nl>
Date: Wed, 4 May 2016 09:32:41 +0000
Subject: [PATCH] -Added environment variable option (NO_EXIT) to unb_error.

---
 tools/quartus/generic.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/quartus/generic.sh b/tools/quartus/generic.sh
index 25ea0f76d3..548f01bd57 100755
--- a/tools/quartus/generic.sh
+++ b/tools/quartus/generic.sh
@@ -46,7 +46,8 @@ unb_error() {
     echo -en '\E[40;36m'"\033[1m[${caller}]\033[0m "
     echo -e '\E[40;31m'"\033[1mERROR - ${msg}. \033[0m "
     tput sgr0
-    exit ${exitcode} 
+    # Exit if $NO_EXIT does not exist, else only return.
+    if [ -z ${NO_EXIT} ]; then exit ${exitcode}; else return 1; fi
 }
 
 # Non-exiting version of unb_error in case we wish to accumulate errors and
-- 
GitLab