Files
dokku/plugins/apps/subcommands/exists
Jose Diaz-Gonzalez 72f53f9f1b refactor: use apps_exists helper where appropriate
This centralizes the logic around checking if an application exists.
2018-04-07 15:04:51 -04:00

18 lines
396 B
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
apps_exists_cmd() {
declare desc="checks if an app exists"
local cmd="apps:exists"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
if ! apps_exists "$APP"; then
dokku_log_fail "App does not exist"
fi
dokku_log_info1 "App already exists"
}
apps_exists_cmd "$@"