mirror of
				https://github.com/beego/bee.git
				synced 2025-11-03 23:03:27 +00:00 
			
		
		
		
	feat: support bee workspace specify
support bee workspace specify instead of current path only
This commit is contained in:
		
							
								
								
									
										9
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								main.go
									
									
									
									
									
								
							@@ -25,9 +25,15 @@ import (
 | 
				
			|||||||
	"github.com/beego/bee/utils"
 | 
						"github.com/beego/bee/utils"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var (
 | 
				
			||||||
 | 
						workspace = os.Getenv("BeeWorkspace")
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func main() {
 | 
					func main() {
 | 
				
			||||||
	currentpath, _ := os.Getwd()
 | 
						currentpath, _ := os.Getwd()
 | 
				
			||||||
 | 
						if workspace != "" {
 | 
				
			||||||
 | 
							currentpath = workspace
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	flag.Usage = cmd.Usage
 | 
						flag.Usage = cmd.Usage
 | 
				
			||||||
	flag.Parse()
 | 
						flag.Parse()
 | 
				
			||||||
	log.SetFlags(0)
 | 
						log.SetFlags(0)
 | 
				
			||||||
@@ -66,7 +72,6 @@ func main() {
 | 
				
			|||||||
			if utils.IsInGOPATH(currentpath) && cmd.IfGenerateDocs(c.Name(), args) {
 | 
								if utils.IsInGOPATH(currentpath) && cmd.IfGenerateDocs(c.Name(), args) {
 | 
				
			||||||
				swaggergen.ParsePackagesFromDir(currentpath)
 | 
									swaggergen.ParsePackagesFromDir(currentpath)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					 | 
				
			||||||
			os.Exit(c.Run(c, args))
 | 
								os.Exit(c.Run(c, args))
 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user