From fdf0e9c768f231a2d10af756aef2a21c3b296d5a Mon Sep 17 00:00:00 2001 From: xhzhang Date: Thu, 21 Dec 2017 23:32:40 +0800 Subject: [PATCH] feat: support bee workspace specify support bee workspace specify instead of current path only --- main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index beccb06..ef51e0d 100644 --- a/main.go +++ b/main.go @@ -25,9 +25,15 @@ import ( "github.com/beego/bee/utils" ) +var ( + workspace = os.Getenv("BeeWorkspace") +) + func main() { currentpath, _ := os.Getwd() - + if workspace != "" { + currentpath = workspace + } flag.Usage = cmd.Usage flag.Parse() log.SetFlags(0) @@ -66,7 +72,6 @@ func main() { if utils.IsInGOPATH(currentpath) && cmd.IfGenerateDocs(c.Name(), args) { swaggergen.ParsePackagesFromDir(currentpath) } - os.Exit(c.Run(c, args)) return }