refactor: unify command declaration across codebase
This commit is contained in:
1 parent
b0abeb49dd
commit
e67b96780d
108 files changed
+475
-315
No files matched your search
@@ -7,10 +7,12 @@ source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||
|
||||
cmd-ps-set-restart-policy() {
|
||||
declare desc="sets app restart-policy"
|
||||
local cmd="ps:set-restart-policy"
|
||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
verify_app_name "$2" && local APP="$2"
|
||||
local RESTART_POLICY="$3"
|
||||
declare cmd="ps:set-restart-policy"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1" RESTART_POLICY="$2"
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
verify_app_name "$APP"
|
||||
local RE_RESTART_POLICY="^(no|unless-stopped|always|on-failure(:[1-9][0-9]*)?)$"
|
||||
|
||||
if [[ ! "$RESTART_POLICY" =~ $RE_RESTART_POLICY ]]; then
|
||||
|
||||
Reference in new issue
Block a user