Skip to content

Commit 25063a6

Browse files
committed
fix bee.json & Beefile watch_ext doesn't work
1 parent e90da8f commit 25063a6

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

Beefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: 0
22
go_install: false
3-
watch_ext: []
3+
watch_ext: [".go"]
4+
watch_ext_static: [".html", ".tpl", ".js", ".css"]
45
dir_structure:
56
watch_all: false
67
controllers: ""

bee.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"version": 0,
33
"go_install": false,
4-
"watch_ext": [],
4+
"watch_ext": [".go"],
5+
"watch_ext_static": [".html", ".tpl", ".js", ".css"],
56
"dir_structure": {
67
"watch_all": false,
78
"controllers": "",

cmd/commands/run/watch.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ var (
3636
state sync.Mutex
3737
eventTime = make(map[string]int64)
3838
scheduleTime time.Time
39-
watchExts = []string{".go"}
40-
watchExtsStatic = []string{".html", ".tpl", ".js", ".css"}
39+
watchExts = config.Conf.WatchExts
40+
watchExtsStatic = config.Conf.WatchExtsStatic
4141
ignoredFilesRegExps = []string{
4242
`.#(\w+).go`,
4343
`.(\w+).go.swp`,

config/conf.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const confVer = 0
2727

2828
var Conf = struct {
2929
Version int
30+
WatchExts []string `json:"watch_ext" yaml:"watch_ext"`
31+
WatchExtsStatic []string `json:"watch_ext_static" yaml:"watch_ext_static"`
3032
GoInstall bool `json:"go_install" yaml:"go_install"` // Indicates whether execute "go install" before "go build".
3133
DirStruct dirStruct `json:"dir_structure" yaml:"dir_structure"`
3234
CmdArgs []string `json:"cmd_args" yaml:"cmd_args"`
@@ -37,7 +39,9 @@ var Conf = struct {
3739
EnableNotification bool `json:"enable_notification" yaml:"enable_notification"`
3840
Scripts map[string]string `json:"scripts" yaml:"scripts"`
3941
}{
40-
GoInstall: true,
42+
WatchExts: []string{".go"},
43+
WatchExtsStatic: []string{".html", ".tpl", ".js", ".css"},
44+
GoInstall: true,
4145
DirStruct: dirStruct{
4246
Others: []string{},
4347
},

0 commit comments

Comments
 (0)