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