This commit is contained in:
Xavier 2020-12-04 23:49:07 -08:00 committed by GitHub
commit 93e047e3fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -88,7 +88,7 @@ func IsInGOPATH(thePath string) bool {
// IsBeegoProject checks whether the current path is a Beego application or not
func IsBeegoProject(thePath string) bool {
mainFiles := []string{}
hasBeegoRegex := regexp.MustCompile(`(?s)package main.*?import.*?\(.*?github.com/astaxie/beego".*?\).*func main()`)
hasBeegoRegex := regexp.MustCompile(`(?s)package main.*?import.*?\(.*?github.com/astaxie/beego".*?\).*func main\(\)`)
c := make(chan error)
// Walk the application path tree to look for main files.
// Main files must satisfy the 'hasBeegoRegex' regular expression.
@ -162,8 +162,10 @@ func AskForConfirmation() bool {
if err != nil {
beeLogger.Log.Fatalf("%s", err)
}
okayResponses := []string{"y", "Y", "yes", "Yes", "YES"}
nokayResponses := []string{"n", "N", "no", "No", "NO"}
response = strings.ToLower(strings.TrimSpace(response))
okayResponses := []string{"y", "yes"}
nokayResponses := []string{"n", "no"}
if containsString(okayResponses, response) {
return true
} else if containsString(nokayResponses, response) {