mirror of
https://github.com/beego/bee.git
synced 2024-11-22 05:00:54 +00:00
Add conf option for watch all
This commit is contained in:
parent
1421e371a8
commit
1a352bc6b3
12
bee.json
12
bee.json
@ -7,19 +7,11 @@
|
|||||||
"go_install": false,
|
"go_install": false,
|
||||||
"watch_ext": [],
|
"watch_ext": [],
|
||||||
"dir_structure": {
|
"dir_structure": {
|
||||||
|
"watch_all": false,
|
||||||
"controllers": "",
|
"controllers": "",
|
||||||
"models": "",
|
"models": "",
|
||||||
"others": []
|
"others": []
|
||||||
},
|
},
|
||||||
"cmd_args": [],
|
"cmd_args": [],
|
||||||
"envs": [],
|
"envs": []
|
||||||
"bale": {
|
|
||||||
"import": "github.com/beego/beeweb/bale",
|
|
||||||
"dirs": [
|
|
||||||
"views", "static"
|
|
||||||
],
|
|
||||||
"ignore_ext": [
|
|
||||||
".go", ".DS_Store"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
8
conf.go
8
conf.go
@ -29,11 +29,14 @@ var defaultConf = `{
|
|||||||
},
|
},
|
||||||
"go_install": false,
|
"go_install": false,
|
||||||
"watch_ext": [],
|
"watch_ext": [],
|
||||||
"dir_structure":{
|
"dir_structure": {
|
||||||
|
"watch_all": false,
|
||||||
"controllers": "",
|
"controllers": "",
|
||||||
"models": "",
|
"models": "",
|
||||||
"others": []
|
"others": []
|
||||||
}
|
},
|
||||||
|
"cmd_args": [],
|
||||||
|
"envs": []
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
var conf struct {
|
var conf struct {
|
||||||
@ -47,6 +50,7 @@ var conf struct {
|
|||||||
GoInstall bool `json:"go_install"`
|
GoInstall bool `json:"go_install"`
|
||||||
WatchExt []string `json:"watch_ext"`
|
WatchExt []string `json:"watch_ext"`
|
||||||
DirStruct struct {
|
DirStruct struct {
|
||||||
|
WatchAll bool `json:"watch_all"`
|
||||||
Controllers string
|
Controllers string
|
||||||
Models string
|
Models string
|
||||||
Others []string // Other directories.
|
Others []string // Other directories.
|
||||||
|
2
run.go
2
run.go
@ -69,7 +69,7 @@ func runApp(cmd *Command, args []string) {
|
|||||||
|
|
||||||
var paths []string
|
var paths []string
|
||||||
|
|
||||||
if len(args) > 0 && args[len(args)-1] == "watchall" {
|
if conf.DirStruct.WatchAll || (len(args) > 0 && args[len(args)-1] == "watchall") {
|
||||||
readAppDirectories(crupath, &paths)
|
readAppDirectories(crupath, &paths)
|
||||||
} else {
|
} else {
|
||||||
paths = append(paths,
|
paths = append(paths,
|
||||||
|
Loading…
Reference in New Issue
Block a user