refactor: unify command declaration across codebase
This commit is contained in:
@@ -6,14 +6,16 @@ source "$PLUGIN_AVAILABLE_PATH/logs/internal-functions"
|
||||
|
||||
cmd-logs-default() {
|
||||
declare desc="display recent log output"
|
||||
local cmd="logs"
|
||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
local APP="$2"
|
||||
verify_app_name "$2"
|
||||
declare cmd="logs"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
verify_app_name "$APP"
|
||||
|
||||
! (is_deployed "$APP") && dokku_log_fail "App $APP has not been deployed"
|
||||
|
||||
shift 2
|
||||
shift 1
|
||||
local TEMP=$(getopt -o htqn:p: --long help,tail,quiet,num:,ps: -n 'dokku logs' -- "$@")
|
||||
local EXIT_CODE="$?"
|
||||
if [[ "$EXIT_CODE" != 0 ]]; then
|
||||
|
||||
@@ -7,8 +7,8 @@ set -eo pipefail
|
||||
|
||||
cmd-logs-failed() {
|
||||
declare desc="shows the last failed deploy logs"
|
||||
declare cmd="logs:failed" argv=("$@")
|
||||
[[ ${argv[0]} == "$cmd" ]] && shift 1
|
||||
declare cmd="logs:failed"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1"
|
||||
local DOKKU_SCHEDULER
|
||||
|
||||
|
||||
Reference in New Issue
Block a user