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

@@ -58,21 +58,23 @@ tar_trigger_build() {
cmd-tar-in() {
declare desc="deploys app from tarball on STDIN via command line"
local cmd="tar:in"
local APP="$2"
declare cmd="tar:in"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
verify_app_name "$2"
verify_app_name "$APP"
tee "$DOKKU_ROOT/$APP/src.tar" | wc -c
tar_receive_app "$APP"
}
cmd-tar-from() {
declare desc="deploys app from tarball at URL via command line"
local cmd="tar:from"
verify_app_name "$2"
local APP=$2
local URL=$3
shift 3
declare cmd="tar:from"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1" URL="$2"
verify_app_name "$APP"
shift 2
curl -# --insecure -L "$URL" | tar_in_cmd "tar:in" "$APP" "$@"
}