From f1385197d854551ee5c0a4a4d5bcdf669f5955f1 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Wed, 21 Apr 2021 23:00:36 +0200 Subject: [PATCH] New option to execute all steps regardless of continuity --- sequencer/sequencer.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/sequencer/sequencer.sh b/sequencer/sequencer.sh index 79b7576..657dbee 100755 --- a/sequencer/sequencer.sh +++ b/sequencer/sequencer.sh @@ -8,7 +8,7 @@ ## Version information VERSION_REV=13 -VERSION_MAJOR=2 +VERSION_MAJOR=3 VERSION_MINOR=0 ## Start of generic script part @@ -59,6 +59,7 @@ helpSequencer() { Usage: ${0##*/} [OPTIONS] [STEP NUMBER(s) or ALIAS] [STEP ARGUMENTS] [OPTIONS] + --all, -a : Run all steps regardless of continuity --config, -c : Open sequence configuration file (also sets -qq) --dry-run, -d : Only print to console what would be done ! Attention - Sequence must support this @@ -530,7 +531,7 @@ initSeqConfig() { echo " [W] Using seq configuration from template $configTemplate" echo " (Copied to $configDir)" SEQ_CONFIG_FILE="$configLoc" - . "$configLoc" + . "$configTemplate" return 0 fi else @@ -780,9 +781,15 @@ step() { # (max $MAX_STEP) # execute sequence continously from given starting step continous() { + local continous_all=0 local continous_i local continous_step=0 + if [ "$1" == "-a" ]; then + continous_all=1 + shift + fi + checkStep "$1" continous_step=$? [[ $continous_step == 0 ]] && return 1 @@ -791,7 +798,7 @@ continous() { for ((continous_i=$continous_step; continous_i<=${MAX_STEP}; continous_i++)); do execute -q $continous_i - [ $? -ne 0 ] && break + [ $? -ne 0 ] && [ $continous_all -eq 0 ] && break [ $STEP_RETURN -ne 0 ] && break done return $STEP_RETURN @@ -1070,11 +1077,15 @@ exep() { main() { local arg local START=0 + local STARTALL local EMPTYCALL=1 # options check for arg in "$@" ; do case "$1" in + --all|-a) # execute all steps; regardless continouity + STARTALL="-a" + shift;; --config|-c) # open sequence configuration file QUIET=2 SEQ_CONFIG_EDIT=1 @@ -1203,7 +1214,7 @@ main() { elif [ "${#START[@]}" -gt "1" ]; then selection "${START[@]}" else - continous $START + continous $STARTALL $START fi }