From dfe588d7f8ddb503ea66df484b1c085114bd12fb Mon Sep 17 00:00:00 2001 From: 3wc <3wc.git@doesthisthing.work> Date: Sun, 13 Sep 2020 17:42:03 +0200 Subject: [PATCH] Don't try and show $DOMAIN if undefined Fixes #11 --- abra | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/abra b/abra index a9f16ae..6ba9474 100755 --- a/abra +++ b/abra @@ -87,7 +87,9 @@ sub_deploy (){ echo "About to deploy:" echo " Compose: $(tput setaf 3)${PWD}/${COMPOSE}$(tput sgr0)" - echo " Domain: $(tput setaf 2)${DOMAIN}$(tput sgr0)" + if [ -n "$DOMAIN" ]; then + echo " Domain: $(tput setaf 2)${DOMAIN}$(tput sgr0)" + fi echo " Stack: $(tput setaf 1)${STACK_NAME}$(tput sgr0)" read -rp "Continue? (y/[n])? " choice @@ -99,7 +101,11 @@ sub_deploy (){ esac if docker stack deploy -c "$COMPOSE" "$STACK_NAME"; then - echo "$(tput setaf 2)Yay! App should be available at https://${DOMAIN}$(tput sgr0)" + if [ -n "$DOMAIN" ]; then + echo "$(tput setaf 2)Yay! App should be available at https://${DOMAIN}$(tput sgr0)" + else + echo "$(tput setaf 2)Yay! That worked. No \$DOMAIN defined, check logs.(tput sgr0)" + fi else echo "$(tput setaf 1)Oh no! Something went wrong 😕 Check errors above$(tput sgr0)" fi