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

Function buildResolveProject

apps/cli/internal/cli/web.go:160–185  ·  view source on GitHub ↗

buildResolveProject returns a function that resolves a project ID to its scan directory and phases, reading directly from the project's .taskmd.yaml.

()

Source from the content-addressed store, hash-verified

158// buildResolveProject returns a function that resolves a project ID to its
159// scan directory and phases, reading directly from the project's .taskmd.yaml.
160func buildResolveProject() web.ProjectResolverFunc {
161 return func(id string) (string, []web.PhaseInfo, error) {
162 entries, err := LoadGlobalRegistry()
163 if err != nil {
164 return "", nil, fmt.Errorf("load global registry: %w", err)
165 }
166
167 entry, found := findProjectEntry(entries, id)
168 if !found {
169 return "", nil, web.ErrProjectNotFound
170 }
171
172 info, statErr := os.Stat(entry.Path)
173 if statErr != nil || !info.IsDir() {
174 return "", nil, fmt.Errorf("project path does not exist: %s", entry.Path)
175 }
176
177 scanDir, err := resolveProjectTaskDirStandalone(entry.Path)
178 if err != nil {
179 return "", nil, err
180 }
181
182 phases := loadProjectPhases(entry.Path)
183 return scanDir, phases, nil
184 }
185}
186
187// resolveProjectTaskDirStandalone reads a project's .taskmd.yaml without viper
188// to determine the task directory.

Callers 1

runWebStartFunction · 0.85

Calls 4

LoadGlobalRegistryFunction · 0.85
findProjectEntryFunction · 0.85
loadProjectPhasesFunction · 0.85

Tested by

no test coverage detected