Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Bugfix y/N confirmation #1277

Merged
merged 2 commits into from
Sep 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions buffalo/cmd/destroy/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ func confirm(msg string) bool {
}

func removeTemplates(fileName string) {
if YesToAll || confirm("Want to remove templates? (Y/n)") {
if YesToAll || confirm("Want to remove templates? (y/N)") {
templatesFolder := filepath.Join("templates", fileName)
logrus.Infof("- Deleted %v folder\n", templatesFolder)
os.RemoveAll(templatesFolder)
}
}

func removeActions(fileName string) error {
if YesToAll || confirm("Want to remove actions? (Y/n)") {
if YesToAll || confirm("Want to remove actions? (y/N)") {
logrus.Infof("- Deleted %v\n", fmt.Sprintf("actions/%v.go", fileName))
os.Remove(filepath.Join("actions", fmt.Sprintf("%v.go", fileName)))

Expand Down Expand Up @@ -91,13 +91,13 @@ func removeActions(fileName string) error {
}

func removeLocales(fileName string) {
if YesToAll || confirm("Want to remove locales? (Y/n)") {
if YesToAll || confirm("Want to remove locales? (y/N)") {
removeMatch("locales", fmt.Sprintf("%v.*.yaml", fileName))
}
}

func removeModel(name string) {
if YesToAll || confirm("Want to remove model? (Y/n)") {
if YesToAll || confirm("Want to remove model? (y/N)") {
modelFileName := inflect.Singularize(inflect.Underscore(name))

os.Remove(filepath.Join("models", fmt.Sprintf("%v.go", modelFileName)))
Expand All @@ -109,7 +109,7 @@ func removeModel(name string) {
}

func removeMigrations(fileName string) {
if YesToAll || confirm("Want to remove migrations? (Y/n)") {
if YesToAll || confirm("Want to remove migrations? (y/N)") {
removeMatch("migrations", fmt.Sprintf("*_create_%v.up.*", fileName))
removeMatch("migrations", fmt.Sprintf("*_create_%v.down.*", fileName))
}
Expand Down