mirror of
https://github.com/beego/bee.git
synced 2025-07-05 18:20:18 +00:00
Added func getControllerInfo
This commit is contained in:
17
run.go
17
run.go
@ -38,11 +38,17 @@ var appname string
|
||||
var conf struct {
|
||||
// Indicates whether execute "go install" before "go build".
|
||||
GoInstall bool `json:"go_install"`
|
||||
|
||||
DirStruct struct {
|
||||
Controllers string
|
||||
Models string
|
||||
Others []string // Other directories.
|
||||
} `json:"dir_structure"`
|
||||
Files []string
|
||||
|
||||
MainFiles struct {
|
||||
Main string `json:"main.go"`
|
||||
Others []string // Others files of package main.
|
||||
} `json:"main_files"`
|
||||
}
|
||||
|
||||
func runApp(cmd *Command, args []string) {
|
||||
@ -60,8 +66,10 @@ func runApp(cmd *Command, args []string) {
|
||||
var paths []string
|
||||
paths = append(paths,
|
||||
path.Join(crupath, conf.DirStruct.Controllers),
|
||||
path.Join(crupath, conf.DirStruct.Models))
|
||||
paths = append(paths, conf.Files...)
|
||||
path.Join(crupath, conf.DirStruct.Models),
|
||||
path.Join(crupath, conf.MainFiles.Main))
|
||||
paths = append(paths, conf.DirStruct.Others...)
|
||||
paths = append(paths, conf.MainFiles.Others...)
|
||||
|
||||
NewWatcher(paths)
|
||||
appname = args[0]
|
||||
@ -94,5 +102,8 @@ func loadConfig() error {
|
||||
if len(conf.DirStruct.Models) == 0 {
|
||||
conf.DirStruct.Models = "models"
|
||||
}
|
||||
if len(conf.MainFiles.Main) == 0 {
|
||||
conf.MainFiles.Main = "main.go"
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user