diff --git a/app.go b/app.go index a2ed46a..a2b8999 100644 --- a/app.go +++ b/app.go @@ -110,16 +110,21 @@ func NewApp() *App { func recursiveTomlSearch(root, tomlType string) ([]string, error) { var matches []string - err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { + err := filepath.WalkDir(root, func(path string, entry os.DirEntry, err error) error { if err != nil { return err } - if info.IsDir() || filepath.Ext(info.Name()) != ".toml" { + // Skip certain directories + if entry.IsDir() && (entry.Name() == "venv" || entry.Name() == ".venv" || strings.HasPrefix(entry.Name(), ".")) { + return filepath.SkipDir + } + + if entry.IsDir() || filepath.Ext(entry.Name()) != ".toml" { return nil } - if info.Name() == tomlType+".toml" || strings.HasSuffix(info.Name(), "."+tomlType+".toml") { + if entry.Name() == tomlType+".toml" || strings.HasSuffix(entry.Name(), "."+tomlType+".toml") { matches = append(matches, path) }