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

Function checkTaskReferences

apps/cli/internal/cli/rm.go:113–120  ·  view source on GitHub ↗

checkTaskReferences returns an error if any other task references the given ID.

(taskID string, tasks []*model.Task)

Source from the content-addressed store, hash-verified

111
112// checkTaskReferences returns an error if any other task references the given ID.
113func checkTaskReferences(taskID string, tasks []*model.Task) error {
114 refs := findReferencingTasks(taskID, tasks)
115 if len(refs) > 0 {
116 return fmt.Errorf("task %s is referenced by other tasks (use --force to delete anyway):\n%s",
117 taskID, formatReferencingTasks(refs))
118 }
119 return nil
120}
121
122// resolveRelPath returns the task file path relative to the scan directory.
123func resolveRelPath(scanDir, filePath string) string {

Callers 1

runRmFunction · 0.85

Calls 2

findReferencingTasksFunction · 0.85
formatReferencingTasksFunction · 0.85

Tested by

no test coverage detected