1
0
mirror of https://github.com/go-task/task.git synced 2025-03-05 15:05:42 +02:00

watch: ignore usually big dirs

Two items by now:
- ".git"
- "node_modules"
This commit is contained in:
Andrey Nering 2017-08-05 13:35:10 -03:00
parent e765b7a9c4
commit e78e4e6a2e

View File

@ -9,6 +9,11 @@ import (
"github.com/radovskyb/watcher"
)
var watchIgnoredDirs = []string{
".git",
"node_modules",
}
// watchTasks start watching the given tasks
func (e *Executor) watchTasks(args ...string) error {
e.printfln("task: Started watching for tasks: %s", strings.Join(args, ", "))
@ -34,6 +39,9 @@ func (e *Executor) watchTasks(args ...string) error {
w := watcher.New()
defer w.Close()
w.SetMaxEvents(1)
if err := w.Ignore(watchIgnoredDirs...); err != nil {
return err
}
go func() {
for {