ignore chmod events

This commit is contained in:
alessio 2016-08-01 00:17:53 +02:00
parent 5396f5de9f
commit a589ad57a2
1 changed files with 6 additions and 6 deletions

View File

@ -55,10 +55,10 @@ func (h *Config) Watch() error{
for { for {
select { select {
case event := <-watcher.Events: case event := <-watcher.Events:
log.Println("event:", event) if event.Op&fsnotify.Chmod == fsnotify.Chmod {
if event.Op&fsnotify.Write == fsnotify.Write { continue
log.Println("modified file:", event.Name)
} }
log.Println("event:", event)
case err := <-watcher.Errors: case err := <-watcher.Errors:
log.Println("error:", err) log.Println("error:", err)
} }
@ -75,10 +75,10 @@ func (h *Config) Watch() error{
// loop projects // loop projects
for _, val := range h.Projects { for _, val := range h.Projects {
// add paths // add paths
for _, path := range val.Watcher.Paths { for _, dir := range val.Watcher.Paths {
p, _ := os.Getwd() path, _ := os.Getwd()
current = val.Watcher current = val.Watcher
if err := filepath.Walk(p+path, walk); err != nil{ if err := filepath.Walk(path+dir, walk); err != nil{
fmt.Println(err) fmt.Println(err)
} }
} }