From abaeee04519363cdfe55962f4598ed1e1ee4cd51 Mon Sep 17 00:00:00 2001 From: Jenia Kogan Date: Wed, 15 May 2024 11:20:52 +0300 Subject: [PATCH] Add `set -e` to the script Exit upon error Will handle the wrong parameter passing to the script --- fw-tools/edge-testnet | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fw-tools/edge-testnet b/fw-tools/edge-testnet index 78d71a5..c53fb37 100755 --- a/fw-tools/edge-testnet +++ b/fw-tools/edge-testnet @@ -9,6 +9,8 @@ # allows you to use port 443 as well. # - k8s and gateway service is available only via port 443. # +set -e + DEBUG=0 FAILURES=0 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -383,8 +385,9 @@ argprocessor() { --domain) DOMAIN_NAME="$2"; shift 2 ;; # --) shift; break ;; + # *) >&2 echo Unsupported option: "$1" - usage ;; + usage ;; esac done @@ -393,7 +396,8 @@ argprocessor() { set -x fi - # Check if either --env or --domain arguments were provided + # If neither --env or --domain arguments are provided + # The ENV is set to production. if [[ -z "$ENV" && -z "$DOMAIN_NAME" ]]; then echo "The env will be set to production." ENV="production"