1
0
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:
Unknown
2013-07-27 09:44:44 +08:00
parent 422e2dc737
commit 7ea67b5534
8 changed files with 622 additions and 8 deletions

17
run.go
View File

@ -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
}