Skip to content

Commit

Permalink
add force flag to destroy command
Browse files Browse the repository at this point in the history
So I can use that in script.
Non interactively.
  • Loading branch information
ianic committed Sep 28, 2021
1 parent 66084d4 commit ef73786
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cli/cmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func addCommandDestroy() {
}

cmd.Flags().Bool("repo", false, "delete local repository")
cmd.Flags().Bool("force", false, "don't ask for confirmation")
cmd.Flags().StringP("stage", "s", config.DefaultStageName, "stage name")
rootCmd.AddCommand(cmd)
}
Expand Down Expand Up @@ -166,7 +167,10 @@ func addCommandWatch() {

func initDestroy(cmd *cobra.Command, args []string) *destroyCmd {
p, path := getProject()
confirmProjectDestroy(p)
force, _ := cmd.Flags().GetBool("force")
if !force {
confirmProjectDestroy(p)
}
stageName, _ := cmd.Flags().GetString("stage")
deleteRepo, _ := cmd.Flags().GetBool("repo")

Expand Down

0 comments on commit ef73786

Please sign in to comment.