Explorar o código

stopped exit from running if no exitcode

Daniel Gibbs %!s(int64=10) %!d(string=hai) anos
pai
achega
7dc2a723d1
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      lgsm/functions/core_exit.sh

+ 3 - 1
lgsm/functions/core_exit.sh

@@ -6,7 +6,7 @@ lgsm_version="210516"
 
 # Description: handles exiting of LGSM by running and reporting an exit code.
 
-if [ "${exitcode}" != "0" ]; then
+if [ -n "${exitcode}" ]||[ "${exitcode}" != "0" ]; then
 	if [ "${exitcode}" == "1" ]; then
 		fn_script_log_fatal "Exiting with code: ${exitcode}"
 	elif [ "${exitcode}" == "2" ]; then
@@ -17,6 +17,8 @@ if [ "${exitcode}" != "0" ]; then
 		fn_script_log "Exiting with code: ${exitcode}"
 	fi
 	exit ${exitcode}
+else
+	exitcode=0
 fi
 
 if [ -f ".dev-debug" ]; then