forked from coop-cloud/abra
fix: handle NoInput for app removal
This commit is contained in:
parent
123619219e
commit
d0945aa09d
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue