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

Function resolveProjectScanDir

apps/cli/internal/cli/projects.go:91–115  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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).
91func 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
117func collectProjectSummaries(projects []GlobalProjectEntry) []ProjectSummary {
118 summaries := make([]ProjectSummary, 0, len(projects))

Callers 2

scanProjectSummaryFunction · 0.85
scanProjectTasksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected