Skip to content

Commit

Permalink
Merge pull request #448 from akupila/master
Browse files Browse the repository at this point in the history
Improve performance by skipping hidden ('.'-prefixed) dirs
  • Loading branch information
riannucci committed Sep 28, 2016
2 parents 5db88ed + ecb8d64 commit 7befa7f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions web/server/watch/imperative_shell.go
Expand Up @@ -5,6 +5,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strings"
)

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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 != "" {
Expand Down

0 comments on commit 7befa7f

Please sign in to comment.