fix: ensure we can call the report subcommand without an app while specifying flags
Closes #2628
This commit is contained in:
@@ -4,8 +4,9 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/ps/functions"
|
||||
|
||||
ps_report_single_app() {
|
||||
local APP="$1"; local APP_DIR="$DOKKU_ROOT/$APP"; local INFO_FLAG="$2"
|
||||
report_single_app() {
|
||||
declare APP="$1" INFO_FLAG="$2"
|
||||
local APP_DIR="$DOKKU_ROOT/$APP"
|
||||
local passed_phases="deploy"
|
||||
local APP_CIDS=$(get_app_container_ids "$APP"); local PROCS=0; local RUNNING=""
|
||||
|
||||
@@ -90,14 +91,24 @@ ps_report_single_app() {
|
||||
ps_report_cmd() {
|
||||
declare desc="shows reports for an app"
|
||||
local cmd="ps:report"
|
||||
local INSTALLED_APPS=$(dokku_apps); local APP
|
||||
local INSTALLED_APPS=$(dokku_apps)
|
||||
local APP="$2" INFO_FLAG="$3"
|
||||
|
||||
if [[ -z $2 ]]; then
|
||||
for APP in $INSTALLED_APPS; do
|
||||
ps_report_single_app "$APP"
|
||||
if [[ -n "$APP" ]] && [[ "$APP" == --* ]]; then
|
||||
INFO_FLAG="$APP"
|
||||
APP=""
|
||||
fi
|
||||
|
||||
if [[ -z "$APP" ]] && [[ -z "$INFO_FLAG" ]]; then
|
||||
INFO_FLAG="true"
|
||||
fi
|
||||
|
||||
if [[ -z "$APP" ]]; then
|
||||
for app in $INSTALLED_APPS; do
|
||||
report_single_app "$app" "$INFO_FLAG" | tee || true
|
||||
done
|
||||
else
|
||||
ps_report_single_app "$2" "$3"
|
||||
report_single_app "$APP" "$INFO_FLAG"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user