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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if shouldIgnoreFile(absFile) {
|
if ShouldIgnoreFile(absFile) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if _, ok := watchedFiles[absFile]; ok {
|
if _, ok := watchedFiles[absFile]; ok {
|
||||||
@ -180,7 +180,7 @@ func (e *Executor) registerWatchedFiles(w *watcher.Watcher, calls ...*ast.Call)
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func shouldIgnoreFile(path string) bool {
|
func ShouldIgnoreFile(path string) bool {
|
||||||
ignorePaths := []string{
|
ignorePaths := []string{
|
||||||
"/.task",
|
"/.task",
|
||||||
"/.git",
|
"/.git",
|
||||||
|
@ -58,7 +58,7 @@ Hello, World!
|
|||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return
|
return
|
||||||
default:
|
default:
|
||||||
err := e.Run(ctx, ast.Task: "default"})
|
err := e.Run(ctx, &ast.Call{Task: "default"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -94,7 +94,7 @@ func TestShouldIgnoreFile(t *testing.T) {
|
|||||||
ct := ct
|
ct := ct
|
||||||
t.Run(fmt.Sprintf("ignore - %d", k), func(t *testing.T) {
|
t.Run(fmt.Sprintf("ignore - %d", k), func(t *testing.T) {
|
||||||
t.Parallel()
|
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