diff --git a/sequencer.sh b/sequencer.sh index a54e93d..e520d66 100755 --- a/sequencer.sh +++ b/sequencer.sh @@ -142,6 +142,11 @@ The sequencer.sh build-in functions are available in all sequence functions: sequencer.sh global variables: + \${LOG_LEVEL} + Control log level directly + 4 - debug -> 0 - silent + \${LOG_TIME} + 1 - Show time stamps before log outputs \${sqr_args} String of all given options \$SEQ_CONFIG_HOME @@ -517,8 +522,6 @@ USAGE_API ## Traps { sqr::trap_exit () { - # Only print if not silent - [[ "${LOG_LEVEL:-0}" -ge ${log_info} ]] && printf '\n%s\n' "$seq_name finished" exists -f seq_trapExit && seq_trapExit debug "Sequencer exit" } @@ -1346,7 +1349,7 @@ execute() { # Display alias if exists exists -f "step_${1}_alias" && stepAlias="$("step_${1}_alias")" - sqr::echo " [i] Stopping sequence at step: $stepAlias" + warning "Stopping sequence at step: $stepAlias" exit 1 ;; esac else @@ -1495,7 +1498,6 @@ sqr::main() { --liststeps|-ls) shift listSteps "${1:-}" - LOG_LEVEL=0 # suppress finish message exit 0 ;; --profile|-p) # seq profile name sqr_args+=" $1 ${2:-}" @@ -1531,7 +1533,6 @@ sqr::main() { shift ;; --version) # version request showVersion - LOG_LEVEL=0 # suppress finish message exit 0 ;; esac done @@ -1624,7 +1625,6 @@ sqr::main() { # Check for profile support if [ -n "${_seq_profileList}" ]; then - LOG_LEVEL=1 # suppress finish message listProfiles "${_seq_profileList}" exit $? elif [ -n "${seq_profileName}" ]; then @@ -1642,4 +1642,9 @@ sqr::main() { } sqr::main "$@" +_sqr_mainReturn="$?" + +silent || printf '\n%s\n' "$seq_name finished" + +exit "${_sqr_mainReturn}"