resolveProjectScanDir reads a project's .taskmd.yaml to find the task directory for scanning. Unlike resolveProjectTaskDir in root.go, this doesn't use viper (avoids polluting global state).
(projectPath string)
| 89 | // resolveProjectScanDir reads a project's .taskmd.yaml to find the task directory for scanning. |
| 90 | // Unlike resolveProjectTaskDir in root.go, this doesn't use viper (avoids polluting global state). |
| 91 | func resolveProjectScanDir(projectPath string) string { |
| 92 | configPath := filepath.Join(projectPath, ".taskmd.yaml") |
| 93 | data, err := os.ReadFile(configPath) |
| 94 | if err != nil { |
| 95 | return filepath.Join(projectPath, "tasks") |
| 96 | } |
| 97 | |
| 98 | var cfg projectDirConfig |
| 99 | if err := yaml.Unmarshal(data, &cfg); err != nil { |
| 100 | return filepath.Join(projectPath, "tasks") |
| 101 | } |
| 102 | |
| 103 | dir := cfg.TaskDir |
| 104 | if dir == "" { |
| 105 | dir = cfg.Dir |
| 106 | } |
| 107 | if dir == "" { |
| 108 | dir = "tasks" |
| 109 | } |
| 110 | |
| 111 | if filepath.IsAbs(dir) { |
| 112 | return dir |
| 113 | } |
| 114 | return filepath.Join(projectPath, dir) |
| 115 | } |
| 116 | |
| 117 | func collectProjectSummaries(projects []GlobalProjectEntry) []ProjectSummary { |
| 118 | summaries := make([]ProjectSummary, 0, len(projects)) |
no outgoing calls
no test coverage detected