Browse Source

feat: support bee workspace specify

  support bee workspace specify instead of current path only
tags/v1.10.0^2
xhzhang 1 year ago
parent
commit
fdf0e9c768
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      main.go

+ 7
- 2
main.go View File

@@ -25,9 +25,15 @@ import (
25 25
 	"github.com/beego/bee/utils"
26 26
 )
27 27
 
28
+var (
29
+	workspace = os.Getenv("BeeWorkspace")
30
+)
31
+
28 32
 func main() {
29 33
 	currentpath, _ := os.Getwd()
30
-
34
+	if workspace != "" {
35
+		currentpath = workspace
36
+	}
31 37
 	flag.Usage = cmd.Usage
32 38
 	flag.Parse()
33 39
 	log.SetFlags(0)
@@ -66,7 +72,6 @@ func main() {
66 72
 			if utils.IsInGOPATH(currentpath) && cmd.IfGenerateDocs(c.Name(), args) {
67 73
 				swaggergen.ParsePackagesFromDir(currentpath)
68 74
 			}
69
-
70 75
 			os.Exit(c.Run(c, args))
71 76
 			return
72 77
 		}

Loading…
Cancel
Save