mirror of
https://github.com/beego/bee.git
synced 2025-06-12 04:50:40 +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:
@ -46,6 +46,8 @@ var (
|
||||
excludedPaths utils.StrFlags
|
||||
// Pass through to -tags arg of "go build"
|
||||
buildTags string
|
||||
// Pass through to -ldflags arg of "go build"
|
||||
buildLDFlags string
|
||||
// Application path
|
||||
currpath string
|
||||
// Application name
|
||||
@ -72,6 +74,7 @@ func init() {
|
||||
CmdRun.Flag.Var(&excludedPaths, "e", "List of paths to exclude.")
|
||||
CmdRun.Flag.BoolVar(&vendorWatch, "vendor", false, "Enable watch vendor folder.")
|
||||
CmdRun.Flag.StringVar(&buildTags, "tags", "", "Set the build tags. See: https://golang.org/pkg/go/build/")
|
||||
CmdRun.Flag.StringVar(&buildLDFlags, "ldflags", "", "Set the build ldflags. See: https://golang.org/pkg/go/build/")
|
||||
CmdRun.Flag.StringVar(&runmode, "runmode", "", "Set the Beego run mode.")
|
||||
CmdRun.Flag.StringVar(&runargs, "runargs", "", "Extra args to run application")
|
||||
CmdRun.Flag.Var(&extraPackages, "ex", "List of extra package to watch.")
|
||||
|
@ -39,11 +39,11 @@ var (
|
||||
watchExts = config.Conf.WatchExts
|
||||
watchExtsStatic = config.Conf.WatchExtsStatic
|
||||
ignoredFilesRegExps = []string{
|
||||
`.#(\w+).go`,
|
||||
`.(\w+).go.swp`,
|
||||
`(\w+).go~`,
|
||||
`(\w+).tmp`,
|
||||
`commentsRouter_controllers.go`,
|
||||
`.#(\w+).go$`,
|
||||
`.(\w+).go.swp$`,
|
||||
`(\w+).go~$`,
|
||||
`(\w+).tmp$`,
|
||||
`commentsRouter_controllers.go$`,
|
||||
}
|
||||
)
|
||||
|
||||
@ -158,6 +158,9 @@ func AutoBuild(files []string, isgenerate bool) {
|
||||
if buildTags != "" {
|
||||
args = append(args, "-tags", buildTags)
|
||||
}
|
||||
if buildLDFlags != "" {
|
||||
args = append(args, "-ldflags", buildLDFlags)
|
||||
}
|
||||
args = append(args, files...)
|
||||
|
||||
bcmd := exec.Command(cmdName, args...)
|
||||
|
Reference in New Issue
Block a user