From ecb8d64d662703d49711121b2ea03f4da8a1cab6 Mon Sep 17 00:00:00 2001 From: akupila Date: Wed, 28 Sep 2016 22:15:44 +0200 Subject: [PATCH] skip directories starting with . --- web/server/watch/imperative_shell.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/server/watch/imperative_shell.go b/web/server/watch/imperative_shell.go index f4e886c9..9d9890d2 100644 --- a/web/server/watch/imperative_shell.go +++ b/web/server/watch/imperative_shell.go @@ -5,6 +5,7 @@ import ( "io/ioutil" "os" "path/filepath" + "strings" ) /////////////////////////////////////////////////////////////////////////////// @@ -33,6 +34,10 @@ func YieldFileSystemItems(root string, excludedDirs []string) chan *FileSystemIt return filepath.SkipDir } + if info.IsDir() && strings.HasPrefix(info.Name(), ".") { + return filepath.SkipDir + } + basePath := filepath.Base(path) for _, item := range excludedDirs { if item == basePath && info.IsDir() && item != "" && basePath != "" {