Browse Source

fix bee.json & Beefile watch_ext doesn't work

tags/v1.10.0^2
Medicean 1 year ago
parent
commit
25063a62c4
4 changed files with 11 additions and 5 deletions
  1. 2
    1
      Beefile
  2. 2
    1
      bee.json
  3. 2
    2
      cmd/commands/run/watch.go
  4. 5
    1
      config/conf.go

+ 2
- 1
Beefile View File

@@ -1,6 +1,7 @@
1 1
 version: 0
2 2
 go_install: false
3
-watch_ext: []
3
+watch_ext: [".go"]
4
+watch_ext_static: [".html", ".tpl", ".js", ".css"]
4 5
 dir_structure:
5 6
   watch_all: false
6 7
   controllers: ""

+ 2
- 1
bee.json View File

@@ -1,7 +1,8 @@
1 1
 {
2 2
 	"version": 0,
3 3
 	"go_install": false,
4
-	"watch_ext": [],
4
+	"watch_ext": [".go"],
5
+	"watch_ext_static": [".html", ".tpl", ".js", ".css"],
5 6
 	"dir_structure": {
6 7
 		"watch_all": false,
7 8
 		"controllers": "",

+ 2
- 2
cmd/commands/run/watch.go View File

@@ -36,8 +36,8 @@ var (
36 36
 	state               sync.Mutex
37 37
 	eventTime           = make(map[string]int64)
38 38
 	scheduleTime        time.Time
39
-	watchExts           = []string{".go"}
40
-	watchExtsStatic     = []string{".html", ".tpl", ".js", ".css"}
39
+	watchExts           = config.Conf.WatchExts
40
+	watchExtsStatic     = config.Conf.WatchExtsStatic
41 41
 	ignoredFilesRegExps = []string{
42 42
 		`.#(\w+).go`,
43 43
 		`.(\w+).go.swp`,

+ 5
- 1
config/conf.go View File

@@ -27,6 +27,8 @@ const confVer = 0
27 27
 
28 28
 var Conf = struct {
29 29
 	Version            int
30
+	WatchExts          []string  `json:"watch_ext" yaml:"watch_ext"`
31
+	WatchExtsStatic    []string  `json:"watch_ext_static" yaml:"watch_ext_static"`
30 32
 	GoInstall          bool      `json:"go_install" yaml:"go_install"` // Indicates whether execute "go install" before "go build".
31 33
 	DirStruct          dirStruct `json:"dir_structure" yaml:"dir_structure"`
32 34
 	CmdArgs            []string  `json:"cmd_args" yaml:"cmd_args"`
@@ -37,7 +39,9 @@ var Conf = struct {
37 39
 	EnableNotification bool              `json:"enable_notification" yaml:"enable_notification"`
38 40
 	Scripts            map[string]string `json:"scripts" yaml:"scripts"`
39 41
 }{
40
-	GoInstall: true,
42
+	WatchExts:       []string{".go"},
43
+	WatchExtsStatic: []string{".html", ".tpl", ".js", ".css"},
44
+	GoInstall:       true,
41 45
 	DirStruct: dirStruct{
42 46
 		Others: []string{},
43 47
 	},

Loading…
Cancel
Save