From 77e4e124532be603075f257ab8173d59d5d336b9 Mon Sep 17 00:00:00 2001 From: Zachary Hu <6426329+outsinre@users.noreply.github.com> Date: Tue, 16 May 2023 11:54:01 +0800 Subject: [PATCH] chore(venv): use 'exit' instead of 'return' upon shell error (#10855) Shell utility 'return' can only be used to return from Shell functions. FTI-5071 --- scripts/dependency_services/common.sh | 2 +- scripts/dependency_services/up.fish | 2 +- scripts/dependency_services/up.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/dependency_services/common.sh b/scripts/dependency_services/common.sh index df5f4aaacf4..22cde66e7bd 100644 --- a/scripts/dependency_services/common.sh +++ b/scripts/dependency_services/common.sh @@ -34,7 +34,7 @@ $DOCKER_COMPOSE up -d if [ $? -ne 0 ]; then echo "Something goes wrong, please check $DOCKER_COMPOSE output" - return + exit 1 fi # [service_name_in_docker_compose]="env_var_name_1:port_1_in_docker_compose env_var_name_2:port_2_in_docker_compose" diff --git a/scripts/dependency_services/up.fish b/scripts/dependency_services/up.fish index da823df8186..f3d83f91c3c 100755 --- a/scripts/dependency_services/up.fish +++ b/scripts/dependency_services/up.fish @@ -8,7 +8,7 @@ bash "$cwd/common.sh" $KONG_SERVICE_ENV_FILE up if test $status -ne 0 echo "Something goes wrong, please check common.sh output" - return + exit 1 end source $KONG_SERVICE_ENV_FILE diff --git a/scripts/dependency_services/up.sh b/scripts/dependency_services/up.sh index a3af6d19e87..ec665a0e132 100755 --- a/scripts/dependency_services/up.sh +++ b/scripts/dependency_services/up.sh @@ -16,7 +16,7 @@ fi bash "$cwd/common.sh" $KONG_SERVICE_ENV_FILE up if [ $? -ne 0 ]; then echo "Something goes wrong, please check common.sh output" - return + exit 1 fi . $KONG_SERVICE_ENV_FILE