From 4251af43b2f42b7b4677701e1485cc89e1ce4737 Mon Sep 17 00:00:00 2001 From: manelcecs Date: Wed, 20 Mar 2024 10:37:33 +0100 Subject: [PATCH] Restore 'STOP_CONTAINERS' flag Reorder validation flag to run first --- bin/test.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/test.sh b/bin/test.sh index 7bb6e794..9b3c29a8 100755 --- a/bin/test.sh +++ b/bin/test.sh @@ -16,6 +16,7 @@ KEEP=0 FORCE_STOP_JEST='--forceExit' ONLY_CONTAINERS=0 COMMAND_ARGS='' +STOP_CONTAINERS=0 function moveToTestDir { cd ${root}/tests @@ -52,6 +53,12 @@ while [ "$1" != "" ]; do shift done +# ONLY_CONTAINERS must be 1 and STOP_CONTAINERS must be 0 +if [ $ONLY_CONTAINERS -eq 1 ] && [ "$STOP_CONTAINERS" -eq 1 ]; then + echo "$USAGE" + exit 1 +fi + # STOP_CONTAINERS is a final option if [[ $STOP_CONTAINERS -eq 1 ]]; then echo "Stopping Docker containers" @@ -60,12 +67,6 @@ if [[ $STOP_CONTAINERS -eq 1 ]]; then exit 0 fi -# ONLY_CONTAINERS must be 1 and STOP must be 0 -if [ $ONLY_CONTAINERS -eq 1 ] && [ "$STOP" -eq 1 ]; then - echo "Invalid options - when using option -oc, option -ns must be used as well" - echo "$USAGE" - exit 1 -fi echo "Starting Docker containers" moveToTestDir