1
0
mirror of https://github.com/beego/bee.git synced 2024-11-29 11:41:28 +00:00

add vendor watch settings

This commit is contained in:
Sergey Lanzman 2016-07-23 01:24:44 +03:00
parent b022ab3277
commit 6192b395d9

9
run.go
View File

@ -23,7 +23,7 @@ import (
) )
var cmdRun = &Command{ var cmdRun = &Command{
UsageLine: "run [appname] [watchall] [-main=*.go] [-downdoc=true] [-gendoc=true] [-e=Godeps -e=folderToExclude] [-tags=goBuildTags]", UsageLine: "run [appname] [watchall] [-main=*.go] [-downdoc=true] [-gendoc=true] [-vendor=true] [-e=folderToExclude] [-tags=goBuildTags]",
Short: "run the app and start a Web server for development", Short: "run the app and start a Web server for development",
Long: ` Long: `
Run command will supervise the file system of the beego project using inotify, Run command will supervise the file system of the beego project using inotify,
@ -43,12 +43,15 @@ var excludedPaths strFlags
// Pass through to -tags arg of "go build" // Pass through to -tags arg of "go build"
var buildTags string var buildTags string
var vendorWatch bool
func init() { func init() {
cmdRun.Run = runApp cmdRun.Run = runApp
cmdRun.Flag.Var(&mainFiles, "main", "specify main go files") cmdRun.Flag.Var(&mainFiles, "main", "specify main go files")
cmdRun.Flag.Var(&gendoc, "gendoc", "auto generate the docs") cmdRun.Flag.Var(&gendoc, "gendoc", "auto generate the docs")
cmdRun.Flag.Var(&downdoc, "downdoc", "auto download swagger file when not exist") cmdRun.Flag.Var(&downdoc, "downdoc", "auto download swagger file when not exist")
cmdRun.Flag.Var(&excludedPaths, "e", "Excluded paths[].") cmdRun.Flag.Var(&excludedPaths, "e", "Excluded paths[].")
cmdRun.Flag.BoolVar(&vendorWatch, "vendor", false, "Watch vendor folder")
cmdRun.Flag.StringVar(&buildTags, "tags", "", "Build tags (https://golang.org/pkg/go/build/)") cmdRun.Flag.StringVar(&buildTags, "tags", "", "Build tags (https://golang.org/pkg/go/build/)")
} }
@ -139,6 +142,10 @@ func readAppDirectories(directory string, paths *[]string) {
continue continue
} }
if !vendorWatch && strings.HasSuffix(fileInfo.Name(), "vendor") {
continue
}
if isExcluded(path.Join(directory, fileInfo.Name())) { if isExcluded(path.Join(directory, fileInfo.Name())) {
continue continue
} }