findAvailablePRD looks for any available PRD in .chief/prds/ Returns the path to the first PRD found, or empty string if none exist.
()
| 85 | // findAvailablePRD looks for any available PRD in .chief/prds/ |
| 86 | // Returns the path to the first PRD found, or empty string if none exist. |
| 87 | func findAvailablePRD() string { |
| 88 | prdsDir := ".chief/prds" |
| 89 | entries, err := os.ReadDir(prdsDir) |
| 90 | if err != nil { |
| 91 | return "" |
| 92 | } |
| 93 | |
| 94 | for _, entry := range entries { |
| 95 | if entry.IsDir() { |
| 96 | prdPath := filepath.Join(prdsDir, entry.Name(), "prd.md") |
| 97 | if _, err := os.Stat(prdPath); err == nil { |
| 98 | return prdPath |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | return "" |
| 103 | } |
| 104 | |
| 105 | // listAvailablePRDs returns all PRD names in .chief/prds/ |
| 106 | func listAvailablePRDs() []string { |
no test coverage detected