diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2020-03-14 21:43:35 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2020-03-14 21:43:35 +0900 |
commit | c39113ee41f032c72a08e015b23d00f60d61a57c (patch) | |
tree | d807431baa670b69b2947c37b6ceef6302642a14 | |
parent | 14f90502a49b868b6c9fed4a86d413427052fb81 (diff) |
[windows] Do not include directories in the list
Fix #1926
-rw-r--r-- | src/reader.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/reader.go b/src/reader.go index 7ed5cfce..06e9b734 100644 --- a/src/reader.go +++ b/src/reader.go @@ -156,10 +156,11 @@ func (r *Reader) readFiles() bool { fn := func(path string, mode os.FileInfo) error { path = filepath.Clean(path) if path != "." { - if mode.Mode().IsDir() && filepath.Base(path)[0] == '.' { + isDir := mode.Mode().IsDir() + if isDir && filepath.Base(path)[0] == '.' { return filepath.SkipDir } - if r.pusher([]byte(path)) { + if !isDir && r.pusher([]byte(path)) { atomic.StoreInt32(&r.event, int32(EvtReadNew)) } } |