Skip to content

Commit

Permalink
add default ignore dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
yinheli committed Jul 2, 2018
1 parent 04e59c5 commit b82637e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/dev-watcher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,18 @@ func main() {
}
}()

ignoreDirs := []string{"vendor", ".git", ".idea", "dist"}
filepath.Walk(*dir, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}

if info.IsDir() {
for _, dir := range ignoreDirs {
if strings.Contains(path, dir) {
return nil
}
}
err = watcher.Add(path)
if err != nil {
l.Println("add watcher error:", err)
Expand Down

0 comments on commit b82637e

Please sign in to comment.