loadProjectPhases reads phases from a project's .taskmd.yaml.
(projectPath string)
| 223 | |
| 224 | // loadProjectPhases reads phases from a project's .taskmd.yaml. |
| 225 | func 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 | |
| 252 | func openBrowser(url string) { |
| 253 | var cmd *exec.Cmd |
no outgoing calls
no test coverage detected