fix: check existence of file go.mod.

This commit is contained in:
zav8 2019-07-13 09:51:11 +08:00
parent b080da776a
commit 2d26bcb157
1 changed files with 5 additions and 1 deletions

View File

@ -29,6 +29,7 @@ import (
"time" "time"
"unicode" "unicode"
"github.com/astaxie/beego/utils"
beeLogger "github.com/beego/bee/logger" beeLogger "github.com/beego/bee/logger"
"github.com/beego/bee/logger/colors" "github.com/beego/bee/logger/colors"
) )
@ -457,8 +458,11 @@ func IsModuleEnabled(gopaths []string, cwd string) bool {
return false return false
} }
} }
return true if utils.FileExists(filepath.Join(cwd, "go.mod")) {
return true
}
} }
return false
} }
// InDir checks whether path is in the file tree rooted at dir. // InDir checks whether path is in the file tree rooted at dir.