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

Function loadProjectPhases

apps/cli/internal/cli/web.go:225–250  ·  view source on GitHub ↗

loadProjectPhases reads phases from a project's .taskmd.yaml.

(projectPath string)

Source from the content-addressed store, hash-verified

223
224// loadProjectPhases reads phases from a project's .taskmd.yaml.
225func loadProjectPhases(projectPath string) []web.PhaseInfo {
226 cfgPath := filepath.Join(projectPath, ".taskmd.yaml")
227 data, err := os.ReadFile(cfgPath)
228 if err != nil {
229 return nil
230 }
231
232 var cfg struct {
233 Phases []struct {
234 ID string `yaml:"id"`
235 Name string `yaml:"name"`
236 Description string `yaml:"description"`
237 } `yaml:"phases"`
238 }
239 if err := yaml.Unmarshal(data, &cfg); err != nil {
240 return nil
241 }
242
243 phases := make([]web.PhaseInfo, 0, len(cfg.Phases))
244 for _, p := range cfg.Phases {
245 if p.ID != "" {
246 phases = append(phases, web.PhaseInfo{ID: p.ID, Name: p.Name, Description: p.Description})
247 }
248 }
249 return phases
250}
251
252func openBrowser(url string) {
253 var cmd *exec.Cmd

Callers 1

buildResolveProjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected