refactor: unify command declaration across codebase

This commit is contained in:
Jose Diaz-Gonzalez
2020-02-10 01:40:30 -05:00
parent b0abeb49dd
commit e67b96780d
108 changed files with 475 additions and 315 deletions

View File

@@ -6,11 +6,13 @@ source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
cmd-docker-options-add() {
declare desc="Add a docker option to application"
local cmd="docker-options:add"
declare cmd="docker-options:add"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
verify_app_name "$2" && local APP="$2"
read -ra passed_phases <<<"$(get_phases "$3")"
shift 3 # everything else passed is the docker option
verify_app_name "$2"
read -ra passed_phases <<<"$(get_phases "$2")"
shift 2 # everything else passed is the docker option
local passed_docker_option="$*"
[[ -z "$passed_docker_option" ]] && dokku_log_fail "Please specify docker options to add to the phase"
add_passed_docker_option passed_phases[@] "${passed_docker_option[@]}"