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

@@ -109,7 +109,7 @@ git_trigger_build() {
git_deploy_branch() {
declare desc="retrieve the deploy branch for a given application"
local cmd="git-hook"
declare cmd="git-hook"
local APP="$1"
local DOKKU_DEPLOY_BRANCH="$(fn-plugin-property-get "git" "$APP" "deploy-branch" "")"
@@ -125,9 +125,11 @@ git_deploy_branch() {
cmd-git-hook() {
declare desc="kick off receive-app trigger from git prereceive hook"
local cmd="git-hook"
local APP="$2"
declare cmd="git-hook"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
local DOKKU_DEPLOY_BRANCH
is_valid_app_name "$APP"
DOKKU_DEPLOY_BRANCH="$(git_deploy_branch "$APP")"
@@ -198,7 +200,9 @@ git_receive_app() {
cmd-git-upload-pack() {
declare desc="executes git-upload-pack"
declare cmd="git-upload-pack"
declare APP="$2"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
APP="$(echo "$APP" | perl -pe 's/(?<!\\)'\''//g' | sed 's/\\'\''/'\''/g' | sed 's/^\///g')"
is_valid_app_name "$APP"
! apps_exists "$APP" >/dev/null 2>&1 && apps_maybe_create "$APP"
@@ -210,7 +214,7 @@ cmd-git-upload-pack() {
cmd-git-glob() {
declare desc="catch-all for any other git-* commands"
local cmd="git-*"
declare cmd="git-*"
local APP="$(echo "$2" | perl -pe 's/(?<!\\)'\''//g' | sed 's/\\'\''/'\''/g' | sed 's/^\///g')"
local APP_PATH=$DOKKU_ROOT/$APP
is_valid_app_name "$APP"