MCPcopy Create free account
hub / github.com/driangle/taskmd / loadPhaseOrder

Function loadPhaseOrder

apps/cli/internal/cli/next.go:286–306  ·  view source on GitHub ↗

loadPhaseOrder reads phase identifiers from the viper config, preserving order. It uses the phase id when present, falling back to name for backwards compatibility.

()

Source from the content-addressed store, hash-verified

284// loadPhaseOrder reads phase identifiers from the viper config, preserving order.
285// It uses the phase id when present, falling back to name for backwards compatibility.
286func loadPhaseOrder() []string {
287 raw := viper.Get("phases")
288 if raw == nil {
289 return nil
290 }
291 items, ok := raw.([]any)
292 if !ok {
293 return nil
294 }
295 var ids []string
296 for _, item := range items {
297 m, ok := item.(map[string]any)
298 if !ok {
299 continue
300 }
301 if id, ok := m["id"].(string); ok && id != "" {
302 ids = append(ids, id)
303 }
304 }
305 return ids
306}
307
308func outputNextJSON(recs []Recommendation) error {
309 return WriteJSON(os.Stdout, recs)

Calls

no outgoing calls