github.com/jacobsoderblom/buffalo@v0.11.0/buffalo/cmd/updater/updater.go (about) 1 package updater 2 3 import ( 4 "bufio" 5 "fmt" 6 "os" 7 "strings" 8 ) 9 10 // Version is the current Buffalo version. It is set here by the cmd package. 11 // This is due to circular dependencies 12 var Version string 13 14 var replace = map[string]string{ 15 "github.com/markbates/pop": "github.com/gobuffalo/pop", 16 "github.com/markbates/validate": "github.com/gobuffalo/validate", 17 "github.com/satori/go.uuid": "github.com/gobuffalo/uuid", 18 } 19 20 var ic = ImportConverter{ 21 Data: replace, 22 } 23 24 var checks = []Check{ 25 ic.Process, 26 WebpackCheck, 27 PackageJSONCheck, 28 DepEnsure, 29 DeprecrationsCheck, 30 } 31 32 func ask(q string) bool { 33 fmt.Printf("? %s [y/n]\n", q) 34 35 reader := bufio.NewReader(os.Stdin) 36 text, _ := reader.ReadString('\n') 37 38 text = strings.ToLower(strings.TrimSpace(text)) 39 return text == "y" || text == "yes" 40 }