aboutsummaryrefslogtreecommitdiffstats
path: root/cmd_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd_windows.go')
-rw-r--r--cmd_windows.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd_windows.go b/cmd_windows.go
index da26684..ef06227 100644
--- a/cmd_windows.go
+++ b/cmd_windows.go
@@ -378,7 +378,8 @@ func sendEvent(conn net.Conn, evt FileEvent) error {
}
func addWatchersRecursively(watcher *fsnotify.Watcher, root string, stack *GitignoreStack) error {
- return filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
+ count := 0
+ err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
@@ -400,10 +401,16 @@ func addWatchersRecursively(watcher *fsnotify.Watcher, root string, stack *Gitig
stack.Push(path)
}
if !stack.IsIgnored(relPath) {
- return watcher.Add(path)
+ if err := watcher.Add(path); err != nil {
+ logErrorf("watch %s: %v", relPath, err)
+ } else {
+ count++
+ }
}
}
return nil
})
+ logInfo("watcher: watching %d directories", count)
+ return err
}