From 998e110c6c1f54ac8fe70732b77d945b7cd45979 Mon Sep 17 00:00:00 2001 From: vCaesar Date: Fri, 9 Dec 2016 01:31:24 +0800 Subject: [PATCH] Update fsnotify --- watch.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/watch.go b/watch.go index b660fe9..3841e67 100644 --- a/watch.go +++ b/watch.go @@ -24,7 +24,7 @@ import ( "sync" "time" - "github.com/howeyc/fsnotify" + "github.com/fsnotify/fsnotify" ) var ( @@ -44,7 +44,7 @@ func NewWatcher(paths []string, files []string, isgenerate bool) { go func() { for { select { - case e := <-watcher.Event: + case e := <-watcher.Events: isbuild := true // Skip ignored files @@ -79,7 +79,7 @@ func NewWatcher(paths []string, files []string, isgenerate bool) { AutoBuild(files, isgenerate) }() } - case err := <-watcher.Error: + case err := <-watcher.Errors: logger.Warnf("Watcher error: %s", err.Error()) // No need to exit here } } @@ -88,7 +88,7 @@ func NewWatcher(paths []string, files []string, isgenerate bool) { logger.Info("Initializing watcher...") for _, path := range paths { logger.Infof(bold("Watching: ")+"%s", path) - err = watcher.Watch(path) + err = watcher.Add(path) if err != nil { logger.Fatalf("Failed to watch directory: %s", err) }