Sequencer returns returnvalue of last executed step

This commit is contained in:
2020-09-30 21:46:50 +02:00
parent 84a798dea5
commit 5aba72ee49

View File

@@ -9,7 +9,7 @@
VERSION_REV=11 VERSION_REV=11
VERSION_MAJOR=0 VERSION_MAJOR=0
VERSION_MINOR=0 VERSION_MINOR=1
## Start of generic script part ## Start of generic script part
@@ -19,6 +19,7 @@ VERBOSE=0
SINGLE=0 SINGLE=0
ERNO=0 ERNO=0
STEP_ARGS= STEP_ARGS=
STEP_RETURN=255
MAX_STEP=512 MAX_STEP=512
ALIAS= ALIAS=
SEQ_CONFIG_NAME=".seqs" SEQ_CONFIG_NAME=".seqs"
@@ -519,6 +520,7 @@ execute() {
case $answer in case $answer in
[yY]) [yY])
step_$1 $1 "${STEP_ARGS[@]}" step_$1 $1 "${STEP_ARGS[@]}"
STEP_RETURN=$?
;; ;;
[sS]) # skip step [sS]) # skip step
return 0 return 0
@@ -537,6 +539,7 @@ execute() {
esac esac
else else
step_$1 $1 "${STEP_ARGS[@]}" step_$1 $1 "${STEP_ARGS[@]}"
STEP_RETURN=$?
fi fi
} }
@@ -560,7 +563,7 @@ checkStep() {
ref=$1 ref=$1
fi fi
if (( $ref < 1 || $ref > $MAX_STEP )) ; then if (( $ref < 1 || $ref > $MAX_STEP )) ; then
echoerr " [E] Invalid step: $ref" echoerr " [E] Invalid step: $ref"
return 0 return 0
else else
@@ -611,6 +614,7 @@ continous() {
break break
fi fi
done done
return $STEP_RETURN
} }
# selection <STEP ARRAY> # selection <STEP ARRAY>
@@ -629,13 +633,13 @@ selection() {
for i in ${array[@]} ; do for i in ${array[@]} ; do
checkStep "$i" checkStep "$i"
step=$? step=$?
# stop on step 0
if [ $step -eq 0 ] ; then if [ $step -eq 0 ] ; then
return 1 return 1
else else
execute $step execute $step
fi fi
done done
return $STEP_RETURN
} }
# Creating a minimal seq (step definition) template # Creating a minimal seq (step definition) template