Move -a processing, another shellcheck fix

This commit is contained in:
3wc 2020-09-11 16:04:48 +02:00
parent 69e00bafd6
commit 8da3e7dfca

12
abra
View File

@ -1,7 +1,12 @@
#!/bin/bash #!/bin/bash
PROGRAM_NAME=""$(basename "$0") 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 )" echo "$(tput setaf 1)ERROR: \$STACK_NAME must be set (e.g. export STACK_NAME=my_cool_app)$(tput sgr0 )"
exit exit
fi fi
@ -93,11 +98,6 @@ sub_logs (){
--timestamps --timestamps
} }
if [ $1 == "-a" ]; then
STACK_NAME=$2
shift 2
fi
subcommand=$1 subcommand=$1
case $subcommand in case $subcommand in
"" | "-h" | "--help") "" | "-h" | "--help")