allow force override

This commit is contained in:
Michael Hobbs committed 2015-01-16 14:57:49 -08:00
1 parent e35493e248
commit 55c2b0fd62
1 file changed
+3 -1
+3 -1
View File
@@ -20,8 +20,9 @@ case "$1" in
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1 [[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
[[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1 [[ ! -d "$DOKKU_ROOT/$2" ]] && echo "App $2 does not exist" && exit 1
[[ "$2" == "tls" ]] && echo "Unable to destroy tls directory" && exit 1 [[ "$2" == "tls" ]] && echo "Unable to destroy tls directory" && exit 1
APP="$2"; IMAGE="dokku/$APP"; APP="$2"; IMAGE="dokku/$APP"; FORCE="$3"
if [[ "$FORCE" != "force" ]]; then
echo " ! WARNING: Potentially Destructive Action" echo " ! WARNING: Potentially Destructive Action"
echo " ! This command will destroy $APP (including all add-ons)." echo " ! This command will destroy $APP (including all add-ons)."
echo " ! To proceed, type \"$APP\"" echo " ! To proceed, type \"$APP\""
@@ -32,6 +33,7 @@ case "$1" in
echo " ! Confirmation did not match $APP. Aborted." echo " ! Confirmation did not match $APP. Aborted."
exit 1 exit 1
fi fi
fi
echo "Destroying $APP (including all add-ons)" echo "Destroying $APP (including all add-ons)"