From b61b8f0d2a17f8dba86d5d409dd691dec28113fe Mon Sep 17 00:00:00 2001 From: cellarspoon Date: Tue, 4 Jan 2022 11:38:07 +0100 Subject: [PATCH] fix: always check for deployed status when removing You can't delete regardless of -f if an app is deployed, the runtime will error out. Best just deal with this for all cases then on our side. --- cli/app/remove.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cli/app/remove.go b/cli/app/remove.go index 877ffcc4..afc21564 100644 --- a/cli/app/remove.go +++ b/cli/app/remove.go @@ -54,14 +54,12 @@ var appRemoveCommand = &cli.Command{ logrus.Fatal(err) } - if !internal.Force { - isDeployed, _, err := stack.IsDeployed(c.Context, cl, app.StackName()) - if err != nil { - logrus.Fatal(err) - } - if isDeployed { - logrus.Fatalf("%s is still deployed. Run \"abra app undeploy %s \" or pass --force", app.Name, app.Name) - } + isDeployed, _, err := stack.IsDeployed(c.Context, cl, app.StackName()) + if err != nil { + logrus.Fatal(err) + } + if isDeployed { + logrus.Fatalf("%s is still deployed. Run \"abra app undeploy %s \" or pass --force", app.Name, app.Name) } fs := filters.NewArgs() @@ -81,6 +79,7 @@ var appRemoveCommand = &cli.Command{ if len(secrets) > 0 { var secretNamesToRemove []string + if !internal.Force { secretsPrompt := &survey.MultiSelect{ Message: "which secrets do you want to remove?",