From aa008a3b7e3d6f25f2417b7afc1f20a323ab11bb Mon Sep 17 00:00:00 2001 From: Stanislas Michalak Date: Thu, 20 Sep 2018 21:33:07 +0200 Subject: [PATCH] Revert breaking change introduced by #235 (#248) Drop command shouldn't need a confirmation, but we should help to prevent bad mistakes. --- soda/cmd/drop.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/soda/cmd/drop.go b/soda/cmd/drop.go index d82be2ba..4f0a4c03 100644 --- a/soda/cmd/drop.go +++ b/soda/cmd/drop.go @@ -2,9 +2,7 @@ package cmd import ( "fmt" - "strings" - "bufio" "os" "github.com/gobuffalo/pop" @@ -12,7 +10,6 @@ import ( ) var all bool -var confirmed bool var dropCmd = &cobra.Command{ Use: "drop", @@ -25,18 +22,6 @@ var dropCmd = &cobra.Command{ os.Exit(1) } - if !confirmed { - reader := bufio.NewReader(os.Stdin) - fmt.Print("Do you really want to drop the database [y/N]? ") - r, _ := reader.ReadString('\n') - r = strings.TrimSpace(r) - if r != "y" && r != "Y" { - fmt.Println("Aborting due to lack of user confirmation.") - os.Exit(0) - } - - } - if all { for _, conn := range pop.Connections { err = pop.DropDB(conn) @@ -54,6 +39,5 @@ var dropCmd = &cobra.Command{ func init() { dropCmd.Flags().BoolVarP(&all, "all", "a", false, "Drops all of the databases in the database.yml") - dropCmd.Flags().BoolVarP(&confirmed, "yes", "y", false, "Runs without asking the user for confirmation") RootCmd.AddCommand(dropCmd) }