MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / findAvailablePRD

Function findAvailablePRD

cmd/chief/main.go:87–103  ·  view source on GitHub ↗

findAvailablePRD looks for any available PRD in .chief/prds/ Returns the path to the first PRD found, or empty string if none exist.

()

Source from the content-addressed store, hash-verified

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.
87func 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/
106func listAvailablePRDs() []string {

Callers 1

runTUIWithOptionsFunction · 0.85

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected