diff --git a/plugins/00_dokku-standard/subcommands/urls b/plugins/00_dokku-standard/subcommands/urls index 8c37b1e53..8f94cbe0d 100755 --- a/plugins/00_dokku-standard/subcommands/urls +++ b/plugins/00_dokku-standard/subcommands/urls @@ -8,7 +8,7 @@ cmd-urls() { declare cmd="url" declare APP="$2" - [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" + [[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on" get_app_urls "$@" } diff --git a/plugins/docker-options/subcommands/add b/plugins/docker-options/subcommands/add index 5d1a692a8..98233ad1a 100755 --- a/plugins/docker-options/subcommands/add +++ b/plugins/docker-options/subcommands/add @@ -10,7 +10,7 @@ cmd-docker-options-add() { [[ "$1" == "$cmd" ]] && shift 1 declare APP="$1" - verify_app_name "$2" + verify_app_name "$APP" read -ra passed_phases <<<"$(get_phases "$2")" shift 2 # everything else passed is the docker option local passed_docker_option="$*" diff --git a/plugins/ssh-keys/internal-functions b/plugins/ssh-keys/internal-functions deleted file mode 100755 index 0a9f01bd0..000000000 --- a/plugins/ssh-keys/internal-functions +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail -[[ $DOKKU_TRACE ]] && set -x - -cmd-ssh-keys-list() { - declare desc="List ssh key hashes" - declare cmd="ssh-keys:list" - [[ "$1" == "$cmd" ]] && shift 1 - - verify_ssh_key_file - sshcommand list dokku -} diff --git a/plugins/ssh-keys/subcommands/list b/plugins/ssh-keys/subcommands/list index d1d699f09..f3abd3803 100755 --- a/plugins/ssh-keys/subcommands/list +++ b/plugins/ssh-keys/subcommands/list @@ -2,6 +2,15 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -source "$PLUGIN_AVAILABLE_PATH/ssh-keys/internal-functions" +source "$PLUGIN_AVAILABLE_PATH/ssh-keys/functions" + +cmd-ssh-keys-list() { + declare desc="List ssh key hashes" + declare cmd="ssh-keys:list" + [[ "$1" == "$cmd" ]] && shift 1 + + verify_ssh_key_file + sshcommand list dokku +} cmd-ssh-keys-list "$@" diff --git a/plugins/storage/subcommands/mount b/plugins/storage/subcommands/mount index 57db21a75..be6e91ea5 100755 --- a/plugins/storage/subcommands/mount +++ b/plugins/storage/subcommands/mount @@ -12,7 +12,9 @@ cmd-storage-mount() { declare APP="$1" MOUNT_PATH="$2" local passed_phases=(deploy run) - [[ -z "$APP" || "$MOUNT_PATH" ]] && dokku_log_fail "storage:mount requires an app and a two paths divided by colon." + [[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on" + [[ -z "$MOUNT_PATH" ]] && dokku_log_fail "Please specify two paths delimited by colon." + verify_app_name "$APP" verify_paths "$MOUNT_PATH" check_if_path_exists "$MOUNT_PATH" "$(get_phase_file_path "${passed_phases[@]}")" && dokku_log_fail "Mount path already exists." diff --git a/plugins/storage/subcommands/unmount b/plugins/storage/subcommands/unmount index f5d77c06c..5fb58010b 100755 --- a/plugins/storage/subcommands/unmount +++ b/plugins/storage/subcommands/unmount @@ -12,7 +12,8 @@ cmd-storage-unmount() { declare APP="$1" MOUNT_PATH="$2" local passed_phases=(deploy run) - [[ -z "$APP" || "$MOUNT_PATH" ]] && dokku_log_fail "storage:unmount requires an app and a two paths divided by colon." + [[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on" + [[ -z "$MOUNT_PATH" ]] && dokku_log_fail "Please specify two paths delimited by colon." verify_app_name "$APP" verify_paths "$MOUNT_PATH" check_if_path_exists "$MOUNT_PATH" "$(get_phase_file_path "${passed_phases[@]}")" || dokku_log_fail "Mount path does not exist." diff --git a/tests/unit/20_config.bats b/tests/unit/20_config.bats index 0ca7f73ba..0d27f0c87 100644 --- a/tests/unit/20_config.bats +++ b/tests/unit/20_config.bats @@ -19,17 +19,10 @@ teardown() { } @test "(config) config:help" { - run /bin/bash -c "dokku config" - echo "output: $output" - echo "status: $status" - assert_output_contains "Manage global and app-specific config vars" - help_output="$output" - run /bin/bash -c "dokku config:help" echo "output: $output" echo "status: $status" assert_output_contains "Manage global and app-specific config vars" - assert_output "$help_output" } @test "(config) config:set --global" { diff --git a/tests/unit/30_events.bats b/tests/unit/30_events.bats index e12098ee2..65a3cc7e6 100644 --- a/tests/unit/30_events.bats +++ b/tests/unit/30_events.bats @@ -13,17 +13,10 @@ teardown() { } @test "(events) events:help" { - run /bin/bash -c "dokku events" - echo "output: $output" - echo "status: $status" - assert_output_contains "Manage event logging" - help_output="$output" - run /bin/bash -c "dokku events:help" echo "output: $output" echo "status: $status" assert_output_contains "Manage event logging" - assert_output "$help_output" } @test "(events) check conffiles" { diff --git a/tests/unit/40_tags.bats b/tests/unit/40_tags.bats index cfa9a569d..4d0b41e21 100644 --- a/tests/unit/40_tags.bats +++ b/tests/unit/40_tags.bats @@ -13,17 +13,10 @@ teardown() { } @test "(tags) tags:help" { - run /bin/bash -c "dokku tags" - echo "output: $output" - echo "status: $status" - assert_output_contains "Manage docker image tags" - help_output="$output" - run /bin/bash -c "dokku tags:help" echo "output: $output" echo "status: $status" assert_output_contains "Manage docker image tags" - assert_output "$help_output" } @test "(tags) tags:create, tags, tags:destroy" {