fix: handle NoInput for app removal

This commit is contained in:
decentral1se 2022-03-11 16:39:20 +01:00
parent 123619219e
commit d0945aa09d
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 6 additions and 2 deletions

View File

@ -40,7 +40,7 @@ var appRemoveCommand = cli.Command{
Action: func(c *cli.Context) error {
app := internal.ValidateApp(c)
if !internal.Force {
if !internal.Force && !internal.NoInput {
response := false
prompt := &survey.Confirm{
Message: fmt.Sprintf("about to remove %s, are you sure?", app.Name),
@ -84,7 +84,7 @@ var appRemoveCommand = cli.Command{
if len(secrets) > 0 {
var secretNamesToRemove []string
if !internal.Force {
if !internal.Force && !internal.NoInput {
secretsPrompt := &survey.MultiSelect{
Message: "which secrets do you want to remove?",
Help: "'x' indicates selected, enter / return to confirm, ctrl-c to exit, vim mode is enabled",
@ -97,6 +97,10 @@ var appRemoveCommand = cli.Command{
}
}
if internal.NoInput {
secretNamesToRemove = secretNames
}
for _, name := range secretNamesToRemove {
err := cl.SecretRemove(context.Background(), secrets[name])
if err != nil {