1
0
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:
Oleg Butuzov
2023-10-08 00:38:14 +03:00
committed by GitHub
parent a70f5aafc2
commit 2f92f2ac5f
2 changed files with 31 additions and 2 deletions

View File

@ -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
}