优化 path(break change)

This commit is contained in:
dengsgo
2019-04-04 10:46:52 +08:00
parent 5c31d76fac
commit 758bd1e409
3 changed files with 6 additions and 10 deletions

View File

@@ -52,7 +52,6 @@ func parseConfig() {
if cfg.Core.Version > Version {
log.Panicln(PreError, "current fileboy support max version : ", Version)
}
cfg.Monitor.RootWatch = false
// init map
cfg.Monitor.TypesMap = map[string]bool{}
cfg.Monitor.IncludeDirsMap = map[string]bool{}
@@ -71,17 +70,13 @@ func eventDispatcher(event fsnotify.Event) {
!keyInMonitorTypesMap(ext, cfg) {
return
}
fileName := relativePath(projectFolder, event.Name)
if !cfg.Monitor.RootWatch && fileName != "filegirl.yaml" {
return
}
switch event.Op {
case
fsnotify.Write,
fsnotify.Rename:
log.Println("EVENT", event.Op.String(), ":", event.Name)
taskMan.Put(&changedFile{
Name: fileName,
Name: relativePath(projectFolder, event.Name),
Changed: time.Now().UnixNano(),
Ext: ext,
})
@@ -104,7 +99,6 @@ func addWatcher() {
log.Fatalln(PreError, "dirs must be relative paths ! err path:", dir)
}
if darr[0] == "." {
cfg.Monitor.RootWatch = true
if len(darr) == 2 && darr[1] == "*" {
// The highest priority
dirsMap = map[string]bool{