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

Function addDependencyEntries

apps/cli/internal/cli/context.go:144–157  ·  view source on GitHub ↗

addDependencyEntries populates the Dependencies field on the result.

(task *model.Task, allTasks []*model.Task, result *taskcontext.Result)

Source from the content-addressed store, hash-verified

142
143// addDependencyEntries populates the Dependencies field on the result.
144func addDependencyEntries(task *model.Task, allTasks []*model.Task, result *taskcontext.Result) {
145 if len(task.Dependencies) == 0 {
146 return
147 }
148 taskMap := buildTaskMap(allTasks)
149 for _, depID := range task.Dependencies {
150 entry := taskcontext.DepEntry{ID: depID}
151 if dep, ok := taskMap[depID]; ok {
152 entry.Title = dep.Title
153 entry.Status = string(dep.Status)
154 }
155 result.Dependencies = append(result.Dependencies, entry)
156 }
157}
158
159func outputContext(result *taskcontext.Result, format string) error {
160 switch format {

Callers 1

runContextFunction · 0.85

Calls 1

buildTaskMapFunction · 0.85

Tested by

no test coverage detected