From bf170236399a94c6b9e8716e7b47ff49ceb2b32e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 23 Nov 2020 00:11:10 -0500 Subject: [PATCH] refactor: simplify ps:scale setup --- plugins/ps/subcommands.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/plugins/ps/subcommands.go b/plugins/ps/subcommands.go index 01d7cf156..49a61b616 100644 --- a/plugins/ps/subcommands.go +++ b/plugins/ps/subcommands.go @@ -158,15 +158,11 @@ func CommandScale(appName string, skipDeploy bool, processTuples []string) error } } - if !hasScaleFile(appName) { - err := common.SuppressOutput(func() error { + if !hasScaleFile(appName) || common.FileExists(procfilePath) { + update := func() error { return updateScalefile(appName, make(map[string]int)) - }) - if err != nil { - return err } - } else if common.FileExists(procfilePath) { - if err := updateScalefile(appName, make(map[string]int)); err != nil { + if err := common.SuppressOutput(update); err != nil { return err } }