fix: handle noinput case

This commit is contained in:
decentral1se 2022-01-01 21:34:58 +01:00
parent 810bc27967
commit 94522178b1
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 11 additions and 9 deletions

View File

@ -105,17 +105,19 @@ You may also invoke this command in "wizard" mode and be prompted for input
table.Render()
response := false
prompt := &survey.Confirm{
Message: "continue with record deletion?",
}
if !internal.NoInput {
response := false
prompt := &survey.Confirm{
Message: "continue with record deletion?",
}
if err := survey.AskOne(prompt, &response); err != nil {
return err
}
if err := survey.AskOne(prompt, &response); err != nil {
return err
}
if !response {
logrus.Fatal("exiting as requested")
if !response {
logrus.Fatal("exiting as requested")
}
}
_, err = provider.DeleteRecords(c.Context, zone, []libdns.Record{toDelete})