From 8da3e7dfca5353c27cd600fd2d1d2da503ac9ffd Mon Sep 17 00:00:00 2001 From: 3wc <3wc.git@doesthisthing.work> Date: Fri, 11 Sep 2020 16:04:48 +0200 Subject: [PATCH] Move -a processing, another shellcheck fix --- abra | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/abra b/abra index ee5058c..9c4b0d0 100755 --- a/abra +++ b/abra @@ -1,7 +1,12 @@ #!/bin/bash PROGRAM_NAME=""$(basename "$0") -if [ -z "$STACK_NAME" ] || [ -z "$STACK_NAME" ]; then +if [ $1 == "-a" ]; then + STACK_NAME=$2 + shift 2 +fi + +if [ -z "$STACK_NAME" ]; then echo "$(tput setaf 1)ERROR: \$STACK_NAME must be set (e.g. export STACK_NAME=my_cool_app)$(tput sgr0 )" exit fi @@ -93,11 +98,6 @@ sub_logs (){ --timestamps } -if [ $1 == "-a" ]; then - STACK_NAME=$2 - shift 2 -fi - subcommand=$1 case $subcommand in "" | "-h" | "--help")