-
Notifications
You must be signed in to change notification settings - Fork 24
Add a --auto-approve
flag to layerform kill
#62
Comments
This should be an easy one, first thing is to add the flag here: killCmd.Flags().Bool("auto-approve", false, "skip interactive approval before killing layer instance") Then, do an if statement over here: if !autoApprove {
var answer string
fmt.Print("Are you sure? This can't be undone. [yes/no]: ")
_, err = fmt.Scan(&answer)
if err != nil {
return errors.Wrap(err, "fail to read asnwer")
}
if strings.ToLower(strings.TrimSpace(answer)) != "yes" {
return nil
}
} Besides that, you'll need to pass some arguments around. I'm happy to further assist. |
Hi, is this issue still available to been worked on? Can i try to fixed with your suggestions? =] |
Hey @hi-hi-ray, yes please. Let me know if you want some help. |
Hi, I created the PR it worked here, but to ensure that everything it's ok I strongly advise that you test in your local environments. =] |
Problem:
When using
layerform
in a script, or CI environment, I want to be able tokill
layer instances without having to answeryes
to the "are you sure?" question.Proposal:
Add a
--auto-approve
flag to thekill
command that makes the cli skip the confirmation when killing a layer instance.The text was updated successfully, but these errors were encountered: