mirror of
https://github.com/go-task/task.git
synced 2024-12-04 10:24:45 +02:00
fix: address compilation error on watch_test.go
Closes #1567 Co-authored-by: sunpe <sunpeng.dev@gmail.com>
This commit is contained in:
parent
1f157fef94
commit
c6c69a5a63
4
watch.go
4
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",
|
||||
|
@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user