sequencer - make use of test -n and for finish message
This commit is contained in:
@@ -373,7 +373,7 @@ endCheckEmpty() {
|
||||
eval 'local ref=$'$1
|
||||
|
||||
if [ -z $ref ] ; then
|
||||
if [ ! -z "$2" ] ; then
|
||||
if [ -n "$2" ] ; then
|
||||
echoerr -e " [E] $2\n Sequence stopped."
|
||||
else
|
||||
echoerr -e " [E] $1 must not be empty.\n Sequence stopped."
|
||||
@@ -765,7 +765,7 @@ execute() {
|
||||
existsFunction step_${1}_alias
|
||||
[ $? -eq 0 ] && step_${1}_alias || ALIAS=
|
||||
printf "\n [%3d] " $1
|
||||
if [ ! -z "$ALIAS" ]; then
|
||||
if [ -n "$ALIAS" ]; then
|
||||
echo -en "${ORANGE}$ALIAS${NC}${SAVE_POS_ALIAS}"
|
||||
# Only add newline if step info() available
|
||||
existsFunction step_${1}_info
|
||||
@@ -1021,7 +1021,7 @@ displayHelp() {
|
||||
CONTEXT_HELP=1
|
||||
|
||||
# check if help is requested for a single step
|
||||
if [ ! -z "$2" ]; then
|
||||
if [ -n "$2" ]; then
|
||||
parseAlias
|
||||
checkStep "$2"
|
||||
loopStart=$?
|
||||
@@ -1035,7 +1035,7 @@ displayHelp() {
|
||||
loopEnd=$loopStart
|
||||
fi
|
||||
|
||||
if [ ! -z $1 ] && [ $1 -eq 1 ] ; then
|
||||
if [ -n "$1" ] && [ $1 -eq 1 ] ; then
|
||||
createTemplate=0
|
||||
fi
|
||||
|
||||
@@ -1157,7 +1157,7 @@ listSteps() {
|
||||
showVersion() {
|
||||
echo "Sequencer ${VERSION_STRING}"
|
||||
echo -n "Seq Revision "
|
||||
if [ ! -z "${VERSION_SEQREV}" ] ; then
|
||||
if [ -n "${VERSION_SEQREV}" ] ; then
|
||||
echo "${VERSION_SEQREV}"
|
||||
else
|
||||
echo "-"
|
||||
@@ -1277,13 +1277,13 @@ main() {
|
||||
fi
|
||||
|
||||
# compatibility check of sequence
|
||||
if [ ! -z $VERSION_SEQREV ] && [ $VERSION_SEQREV -gt $VERSION_REV ] ; then
|
||||
if [ -n "$VERSION_SEQREV" ] && [ $VERSION_SEQREV -gt $VERSION_REV ] ; then
|
||||
echoerr " [E] Unsupported sequence revision"
|
||||
showVersion
|
||||
exit 1
|
||||
fi
|
||||
# exclude older versions if needed
|
||||
if [ ! -z $VERSION_SEQREV ] && [ $VERSION_SEQREV -lt 3 ] ; then
|
||||
if [ -n "$VERSION_SEQREV" ] && [ $VERSION_SEQREV -lt 3 ] ; then
|
||||
echoerr " [E] Unsupported sequence revision (addConf)"
|
||||
showVersion
|
||||
exit 1
|
||||
@@ -1348,7 +1348,7 @@ main() {
|
||||
# Check for profile support
|
||||
if [ $SEQ_PROFILE_LIST -ne 0 ]; then
|
||||
listProfiles; exit $?
|
||||
elif [ ! -z "$SEQ_PROFILE_NAME" ]; then
|
||||
elif [ -n "$SEQ_PROFILE_NAME" ]; then
|
||||
listProfiles -q || exit 1
|
||||
fi
|
||||
|
||||
@@ -1367,7 +1367,7 @@ MAINRETURN=$?
|
||||
|
||||
if [ $QUIET -ne 2 ] ; then
|
||||
echo
|
||||
echo "${0##*/} finished"
|
||||
echo "$SEQ_NAME finished"
|
||||
fi
|
||||
|
||||
exit $MAINRETURN;
|
||||
exit $MAINRETURN
|
||||
|
Reference in New Issue
Block a user