diff --git a/watch.go b/watch.go index 8b841293f6..5ce5f7ee37 100644 --- a/watch.go +++ b/watch.go @@ -157,7 +157,7 @@ func (e *Executor) registerWatchedFiles(w *watcher.Watcher, calls ...*ast.Call) if err != nil { return err } - if shouldIgnoreFile(absFile) { + if ShouldIgnoreFile(absFile) { continue } if _, ok := watchedFiles[absFile]; ok { @@ -180,7 +180,7 @@ func (e *Executor) registerWatchedFiles(w *watcher.Watcher, calls ...*ast.Call) return nil } -func shouldIgnoreFile(path string) bool { +func ShouldIgnoreFile(path string) bool { ignorePaths := []string{ "/.task", "/.git", diff --git a/watch_test.go b/watch_test.go index b63af724d6..f1fb6a218d 100644 --- a/watch_test.go +++ b/watch_test.go @@ -58,7 +58,7 @@ Hello, World! case <-ctx.Done(): return default: - err := e.Run(ctx, ast.Task: "default"}) + err := e.Run(ctx, &ast.Call{Task: "default"}) if err != nil { return } @@ -94,7 +94,7 @@ func TestShouldIgnoreFile(t *testing.T) { ct := ct t.Run(fmt.Sprintf("ignore - %d", k), func(t *testing.T) { t.Parallel() - require.Equal(t, shouldIgnoreFile(ct.path), ct.expect) + require.Equal(t, task.ShouldIgnoreFile(ct.path), ct.expect) }) } }