all repos — homestead @ 5434a11ad1bf6693705a9ba38ec9464f2d001da9

Code for my website

watcher: ignore .git folder

Alan Pearce
commit

5434a11ad1bf6693705a9ba38ec9464f2d001da9

parent

d82b6741867ef70e50f41a0aa08d6a2c63bbfeb9

1 file changed, 4 insertions(+), 0 deletions(-)

jump to
M internal/watcher/watcher.gointernal/watcher/watcher.go
@@ -60,6 +60,10 @@ if err != nil {
return errors.WithMessagef(err, "could not walk directory %s", path) } if entry.IsDir() { + if entry.Name() == ".git" { + l.Debug("skipping directory", "entry", entry.Name()) + return fs.SkipDir + } l.Debug("adding directory to watcher", "path", path) if err = watcher.Add(path); err != nil { return errors.WithMessagef(err, "could not add directory %s to watcher", path)