From a269f8e003d5e4e620b57780eb0fc1bc092a01f3 Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Sun, 17 Jul 2016 15:56:11 -0700 Subject: [PATCH] support --quiet and split up data access from presentation --- plugins/ps/functions | 12 ++++++------ plugins/ps/subcommands/restart-policy | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/ps/functions b/plugins/ps/functions index 9b4fb5b11..a1c0479ab 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -166,14 +166,14 @@ ps_scale() { fi } -get_restart_policies() { - declare desc="strips docker options and prints restart policies" - local -r phase_file_path=$1 - [[ -r "$phase_file_path" ]] && sed -e '/^--restart=/!d' -e 's/^--restart=/ /' < "$phase_file_path" -} - get_raw_restart_policies() { declare desc="strips docker options and prints raw restart policies" local -r phase_file_path=$1 [[ -r "$phase_file_path" ]] && sed -e '/^--restart=/!d' < "$phase_file_path" } + +get_restart_policies() { + declare desc="strips docker options and prints restart policies" + local -r phase_file_path=$1 + get_raw_restart_policies "$phase_file_path" | sed -e 's/^--restart=//g' +} diff --git a/plugins/ps/subcommands/restart-policy b/plugins/ps/subcommands/restart-policy index 9ee8c434b..c73ed72ab 100755 --- a/plugins/ps/subcommands/restart-policy +++ b/plugins/ps/subcommands/restart-policy @@ -11,7 +11,7 @@ ps_restart_policy_cmd() { [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" verify_app_name "$2" && local APP="$2" - echo "$APP restart-policy:" + dokku_log_info2_quiet "$APP restart-policy:" get_restart_policies "$(get_phase_file_path "$passed_phases")" }