mirror of https://github.com/beego/bee.git
Merge da530d986c
into 958e4564d1
This commit is contained in:
commit
93e047e3fd
|
@ -88,7 +88,7 @@ func IsInGOPATH(thePath string) bool {
|
||||||
// IsBeegoProject checks whether the current path is a Beego application or not
|
// IsBeegoProject checks whether the current path is a Beego application or not
|
||||||
func IsBeegoProject(thePath string) bool {
|
func IsBeegoProject(thePath string) bool {
|
||||||
mainFiles := []string{}
|
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)
|
c := make(chan error)
|
||||||
// Walk the application path tree to look for main files.
|
// Walk the application path tree to look for main files.
|
||||||
// Main files must satisfy the 'hasBeegoRegex' regular expression.
|
// Main files must satisfy the 'hasBeegoRegex' regular expression.
|
||||||
|
@ -162,8 +162,10 @@ func AskForConfirmation() bool {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
beeLogger.Log.Fatalf("%s", err)
|
beeLogger.Log.Fatalf("%s", err)
|
||||||
}
|
}
|
||||||
okayResponses := []string{"y", "Y", "yes", "Yes", "YES"}
|
response = strings.ToLower(strings.TrimSpace(response))
|
||||||
nokayResponses := []string{"n", "N", "no", "No", "NO"}
|
|
||||||
|
okayResponses := []string{"y", "yes"}
|
||||||
|
nokayResponses := []string{"n", "no"}
|
||||||
if containsString(okayResponses, response) {
|
if containsString(okayResponses, response) {
|
||||||
return true
|
return true
|
||||||
} else if containsString(nokayResponses, response) {
|
} else if containsString(nokayResponses, response) {
|
||||||
|
|
Loading…
Reference in New Issue