mirror of
https://github.com/beego/bee.git
synced 2025-06-11 13:30:39 +00:00
1. new,api,hprose 命令增加两个参数 [-module=true] [-beego=v1.12.1] 用于生成go module项目
2. generate,migrate命令不再打印GOPATH. 3. pack命令排除。 4. run命令支持传递ldflags参数 5. fix watch file bug.ignoredFilesRegExps数组对每个文件增加$,防止目录存在tmp的情况 6. getPackagePath函数被调用时如果找不到GOPATH,则看看工程有没有go.mod 有就当做go module项目处理。 7. .travis.yml检查时排除/pkg/mod/目录
This commit is contained in:
@ -33,6 +33,14 @@ import (
|
||||
"github.com/beego/bee/logger/colors"
|
||||
)
|
||||
|
||||
func GetBeeWorkPath() string {
|
||||
beePath, err := filepath.Abs(filepath.Dir(os.Args[0]))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return beePath
|
||||
}
|
||||
|
||||
// Go is a basic promise implementation: it wraps calls a function in a goroutine
|
||||
// and returns a channel which will later return the function's return value.
|
||||
func Go(f func() error) chan error {
|
||||
@ -305,6 +313,7 @@ func Tmpl(text string, data interface{}) {
|
||||
func CheckEnv(appname string) (apppath, packpath string, err error) {
|
||||
gps := GetGOPATHs()
|
||||
if len(gps) == 0 {
|
||||
beeLogger.Log.Error("if you want new a go module project,please add param `-module=true` and set env `G111MODULE=on`")
|
||||
beeLogger.Log.Fatal("GOPATH environment variable is not set or empty")
|
||||
}
|
||||
currpath, _ := os.Getwd()
|
||||
|
Reference in New Issue
Block a user