diff --git a/internal/worker/files.go b/internal/worker/files.go index 006a0c6..3231c60 100644 --- a/internal/worker/files.go +++ b/internal/worker/files.go @@ -4,9 +4,9 @@ import ( "fmt" "log" "os" - "path/filepath" "sync" + "github.com/bmatcuk/doublestar" "github.com/fsnotify/fsnotify" ) @@ -73,8 +73,7 @@ func (fw *filesCollector) watch() { func (fw *filesCollector) consumeCreateEvent(event fsnotify.Event) error { for _, ignorePattern := range fw.ignorePatterns { - matched, err := filepath.Match(ignorePattern, event.Name) - fmt.Println(matched, err, ignorePattern, event.Name) + matched, err := doublestar.Match(ignorePattern, event.Name) if err != nil { return fmt.Errorf("could not match pattern: %w", err) } diff --git a/worker-java/main.go b/worker-java/main.go index f8b134e..f5e37f5 100644 --- a/worker-java/main.go +++ b/worker-java/main.go @@ -74,6 +74,5 @@ func main() { Handler: handler, ExecutionDirectory: projectDir, TransformOutput: transformOutput, - IgnoreFilePatterns: []string{filepath.Join(projectDir, "target", "**")}, }).Run() } diff --git a/worker-javascript/main.go b/worker-javascript/main.go index 0bc4a9f..3997131 100644 --- a/worker-javascript/main.go +++ b/worker-javascript/main.go @@ -29,6 +29,6 @@ func handler(w *worker.Worker, code string) error { func main() { worker.NewWorker(&worker.WorkerExectionOptions{ Handler: handler, - IgnoreFilePatterns: []string{"*.last-run.json"}, + IgnoreFilePatterns: []string{"**/*.last-run.json"}, }).Run() }