From 2ff2ca55c1910a31effb0985eb70988f289fdc59 Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Sat, 17 Jan 2015 16:24:50 -0800 Subject: [PATCH] drop support for create/delete in favor of standard apps:create and apps:destroy --- contrib/dokku_client.sh | 11 ++++++----- tests/unit/client.bats | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/contrib/dokku_client.sh b/contrib/dokku_client.sh index 86312c4db..b899a9af1 100755 --- a/contrib/dokku_client.sh +++ b/contrib/dokku_client.sh @@ -54,12 +54,13 @@ if [[ ! -z $DOKKU_HOST ]]; then if [[ "$appname" != "" ]] && [[ -n "$*" ]]; then case "$1" in - apps*|backup*|help|plugins*|ps:restartall|trace|version) + apps|backup*|help|plugins*|ps:restartall|trace|version) true ;; - delete) - verb="apps:destroy" - donotshift="YES" + apps:destroy) + if [[ -z "$2" ]] || [[ "$2" == "force" ]];then + donotshift="YES" + fi ;; *) donotshift="YES" @@ -67,7 +68,7 @@ if [[ ! -z $DOKKU_HOST ]]; then esac fi - if [[ "$1" = "create" ]]; then + if [[ "$1" = "apps:create" ]] && [[ -z "$2" ]]; then appname=$(random_name) counter=0 while ssh "dokku@$DOKKU_HOST" apps 2>/dev/null| grep -q "$appname"; do diff --git a/tests/unit/client.bats b/tests/unit/client.bats index 76ca83d74..4ddb42969 100644 --- a/tests/unit/client.bats +++ b/tests/unit/client.bats @@ -165,13 +165,13 @@ teardown() { assert_success } -@test "dokku client (create/delete)" { +@test "dokku client (apps:create AND apps:destroy)" { setup_client_repo - run bash -c "${BATS_TEST_DIRNAME}/../../contrib/dokku_client.sh create" + run bash -c "${BATS_TEST_DIRNAME}/../../contrib/dokku_client.sh apps:create" echo "output: "$output echo "status: "$status assert_success - run bash -c "${BATS_TEST_DIRNAME}/../../contrib/dokku_client.sh delete force" + run bash -c "${BATS_TEST_DIRNAME}/../../contrib/dokku_client.sh apps:destroy force" echo "output: "$output echo "status: "$status assert_success