From a589ad57a2229b944448e6d625bc8ba150846976 Mon Sep 17 00:00:00 2001 From: alessio Date: Mon, 1 Aug 2016 00:17:53 +0200 Subject: [PATCH] ignore chmod events --- realize/watcher.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/realize/watcher.go b/realize/watcher.go index f0b5663..de5b7c9 100644 --- a/realize/watcher.go +++ b/realize/watcher.go @@ -55,10 +55,10 @@ func (h *Config) Watch() error{ for { select { case event := <-watcher.Events: - log.Println("event:", event) - if event.Op&fsnotify.Write == fsnotify.Write { - log.Println("modified file:", event.Name) + if event.Op&fsnotify.Chmod == fsnotify.Chmod { + continue } + log.Println("event:", event) case err := <-watcher.Errors: log.Println("error:", err) } @@ -75,10 +75,10 @@ func (h *Config) Watch() error{ // loop projects for _, val := range h.Projects { // add paths - for _, path := range val.Watcher.Paths { - p, _ := os.Getwd() + for _, dir := range val.Watcher.Paths { + path, _ := os.Getwd() current = val.Watcher - if err := filepath.Walk(p+path, walk); err != nil{ + if err := filepath.Walk(path+dir, walk); err != nil{ fmt.Println(err) } }