Don't try and show $DOMAIN if undefined

Fixes #11
This commit is contained in:
3wc 2020-09-13 17:42:03 +02:00
parent 09bd22d320
commit dfe588d7f8

6
abra
View File

@ -87,7 +87,9 @@ sub_deploy (){
echo "About to deploy:" echo "About to deploy:"
echo " Compose: $(tput setaf 3)${PWD}/${COMPOSE}$(tput sgr0)" echo " Compose: $(tput setaf 3)${PWD}/${COMPOSE}$(tput sgr0)"
if [ -n "$DOMAIN" ]; then
echo " Domain: $(tput setaf 2)${DOMAIN}$(tput sgr0)" echo " Domain: $(tput setaf 2)${DOMAIN}$(tput sgr0)"
fi
echo " Stack: $(tput setaf 1)${STACK_NAME}$(tput sgr0)" echo " Stack: $(tput setaf 1)${STACK_NAME}$(tput sgr0)"
read -rp "Continue? (y/[n])? " choice read -rp "Continue? (y/[n])? " choice
@ -99,7 +101,11 @@ sub_deploy (){
esac esac
if docker stack deploy -c "$COMPOSE" "$STACK_NAME"; then if docker stack deploy -c "$COMPOSE" "$STACK_NAME"; then
if [ -n "$DOMAIN" ]; then
echo "$(tput setaf 2)Yay! App should be available at https://${DOMAIN}$(tput sgr0)" 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 else
echo "$(tput setaf 1)Oh no! Something went wrong 😕 Check errors above$(tput sgr0)" echo "$(tput setaf 1)Oh no! Something went wrong 😕 Check errors above$(tput sgr0)"
fi fi