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:
parent
e765b7a9c4
commit
e78e4e6a2e
8
watch.go
8
watch.go
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user