mirror of
https://github.com/go-task/task.git
synced 2025-06-23 00:38:19 +02:00
fix: exclude other "ignored" files. (#1356)
This commit is contained in:
14
watch.go
14
watch.go
@ -176,6 +176,16 @@ func (e *Executor) registerWatchedFiles(w *watcher.Watcher, calls ...taskfile.Ca
|
||||
}
|
||||
|
||||
func shouldIgnoreFile(path string) bool {
|
||||
return strings.Contains(path, "/.git") || strings.Contains(path, "/.hg") ||
|
||||
strings.Contains(path, "/.task") || strings.Contains(path, "/node_modules")
|
||||
ignorePaths := []string{
|
||||
"/.task",
|
||||
"/.git",
|
||||
"/.hg",
|
||||
"/.node_modules",
|
||||
}
|
||||
for _, p := range ignorePaths {
|
||||
if strings.Contains(path, fmt.Sprintf("%s/", p)) || strings.HasSuffix(path, p) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user