Skip to content

Commit 81635c0

Browse files
committed
Merge pull request #58 from homburg/fix-modd-filter
Use modd watch mod filter result to apply include/exclude
2 parents c07e318 + 1fb40fb commit 81635c0

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

watch.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ func (r Route) Watch(ch chan []string, excludePatterns []string, log termlog.Log
2222
}
2323
go func() {
2424
for mod := range modchan {
25-
mod.Filter([]string{"*"}, excludePatterns)
26-
if !mod.Empty() {
27-
ch <- mod.All()
25+
filteredMod, err := mod.Filter([]string{"**/*"}, excludePatterns)
26+
if err != nil {
27+
log.Shout("Error filtering watches: %s", err)
28+
}
29+
if !filteredMod.Empty() {
30+
ch <- filteredMod.All()
2831
}
2932
}
3033
}()
@@ -43,9 +46,12 @@ func WatchPaths(paths, excludePatterns []string, reloader livereload.Reloader, l
4346
}
4447
go func() {
4548
for mod := range modchan {
46-
mod.Filter([]string{"*"}, excludePatterns)
47-
if !mod.Empty() {
48-
ch <- mod.All()
49+
filteredMod, err := mod.Filter([]string{"**/*"}, excludePatterns)
50+
if err != nil {
51+
log.Shout("Error filtering watches: %s", err)
52+
}
53+
if !filteredMod.Empty() {
54+
ch <- filteredMod.All()
4955
}
5056
}
5157
}()

0 commit comments

Comments
 (0)