From 25063a62c4fb24ea1d0bc0707213f69842aae10e Mon Sep 17 00:00:00 2001 From: Medicean Date: Mon, 11 Jun 2018 18:01:35 +0800 Subject: [PATCH] fix bee.json & Beefile watch_ext doesn't work --- Beefile | 3 ++- bee.json | 3 ++- cmd/commands/run/watch.go | 4 ++-- config/conf.go | 6 +++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Beefile b/Beefile index d77b2c5..1e0ec87 100644 --- a/Beefile +++ b/Beefile @@ -1,6 +1,7 @@ version: 0 go_install: false -watch_ext: [] +watch_ext: [".go"] +watch_ext_static: [".html", ".tpl", ".js", ".css"] dir_structure: watch_all: false controllers: "" diff --git a/bee.json b/bee.json index 50cbd0e..f314542 100644 --- a/bee.json +++ b/bee.json @@ -1,7 +1,8 @@ { "version": 0, "go_install": false, - "watch_ext": [], + "watch_ext": [".go"], + "watch_ext_static": [".html", ".tpl", ".js", ".css"], "dir_structure": { "watch_all": false, "controllers": "", diff --git a/cmd/commands/run/watch.go b/cmd/commands/run/watch.go index 825b7b9..af1f474 100644 --- a/cmd/commands/run/watch.go +++ b/cmd/commands/run/watch.go @@ -36,8 +36,8 @@ var ( state sync.Mutex eventTime = make(map[string]int64) scheduleTime time.Time - watchExts = []string{".go"} - watchExtsStatic = []string{".html", ".tpl", ".js", ".css"} + watchExts = config.Conf.WatchExts + watchExtsStatic = config.Conf.WatchExtsStatic ignoredFilesRegExps = []string{ `.#(\w+).go`, `.(\w+).go.swp`, diff --git a/config/conf.go b/config/conf.go index eebbce2..9232bb6 100644 --- a/config/conf.go +++ b/config/conf.go @@ -27,6 +27,8 @@ const confVer = 0 var Conf = struct { Version int + WatchExts []string `json:"watch_ext" yaml:"watch_ext"` + WatchExtsStatic []string `json:"watch_ext_static" yaml:"watch_ext_static"` GoInstall bool `json:"go_install" yaml:"go_install"` // Indicates whether execute "go install" before "go build". DirStruct dirStruct `json:"dir_structure" yaml:"dir_structure"` CmdArgs []string `json:"cmd_args" yaml:"cmd_args"` @@ -37,7 +39,9 @@ var Conf = struct { EnableNotification bool `json:"enable_notification" yaml:"enable_notification"` Scripts map[string]string `json:"scripts" yaml:"scripts"` }{ - GoInstall: true, + WatchExts: []string{".go"}, + WatchExtsStatic: []string{".html", ".tpl", ".js", ".css"}, + GoInstall: true, DirStruct: dirStruct{ Others: []string{}, },