listUpdateFiles returns absolute paths to all *.md files under dir, sorted ascending. Missing dir yields an empty slice, not an error.
(dir string)
| 589 | // listUpdateFiles returns absolute paths to all *.md files under dir, |
| 590 | // sorted ascending. Missing dir yields an empty slice, not an error. |
| 591 | func listUpdateFiles(dir string) []string { |
| 592 | entries, err := os.ReadDir(dir) |
| 593 | if err != nil { |
| 594 | return nil |
| 595 | } |
| 596 | var paths []string |
| 597 | for _, e := range entries { |
| 598 | if e.IsDir() { |
| 599 | continue |
| 600 | } |
| 601 | if filepath.Ext(e.Name()) != ".md" { |
| 602 | continue |
| 603 | } |
| 604 | paths = append(paths, filepath.Join(dir, e.Name())) |
| 605 | } |
| 606 | sort.Strings(paths) |
| 607 | return paths |
| 608 | } |
| 609 | |
| 610 | // staleDaysThreshold returns the staleness threshold in days. Reads |
| 611 | // FLOW_STALE_DAYS env var; defaults to 3. |
no test coverage detected