Skip to content

Commit

Permalink
fix: address compilation error on watch_test.go
Browse files Browse the repository at this point in the history
Closes #1567

Co-authored-by: sunpe <sunpeng.dev@gmail.com>
  • Loading branch information
andreynering and sunpe committed Apr 9, 2024
1 parent 1f157fe commit c6c69a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions watch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
})
}
}

0 comments on commit c6c69a5

Please sign in to comment.