(userName string, runningErr error)
| 169 | } |
| 170 | |
| 171 | func (cmd ScaleCommand) showCurrentScale(userName string, runningErr error) error { |
| 172 | if !shouldShowCurrentScale(runningErr) { |
| 173 | return nil |
| 174 | } |
| 175 | |
| 176 | cmd.UI.DisplayTextWithFlavor("Showing current scale of app {{.AppName}} in org {{.OrgName}} / space {{.SpaceName}} as {{.Username}}...", map[string]interface{}{ |
| 177 | "AppName": cmd.RequiredArgs.AppName, |
| 178 | "OrgName": cmd.Config.TargetedOrganization().Name, |
| 179 | "SpaceName": cmd.Config.TargetedSpace().Name, |
| 180 | "Username": userName, |
| 181 | }) |
| 182 | |
| 183 | cmd.UI.DisplayNewline() |
| 184 | |
| 185 | summary, warnings, err := cmd.Actor.GetDetailedAppSummary(cmd.RequiredArgs.AppName, cmd.Config.TargetedSpace().GUID, false) |
| 186 | cmd.UI.DisplayWarnings(warnings) |
| 187 | if err != nil { |
| 188 | return err |
| 189 | } |
| 190 | |
| 191 | appSummaryDisplayer := shared.NewAppSummaryDisplayer(cmd.UI) |
| 192 | appSummaryDisplayer.AppDisplay(summary, false) |
| 193 | return nil |
| 194 | } |
| 195 | |
| 196 | func shouldShowCurrentScale(err error) bool { |
| 197 | if err == nil { |
no test coverage detected