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

Function makeFilePathsRelative

apps/cli/internal/cli/list.go:375–385  ·  view source on GitHub ↗

makeFilePathsRelative converts absolute task file paths to paths relative to baseDir.

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

Source from the content-addressed store, hash-verified

373
374// makeFilePathsRelative converts absolute task file paths to paths relative to baseDir.
375func makeFilePathsRelative(tasks []*model.Task, baseDir string) {
376 absBase, err := filepath.Abs(baseDir)
377 if err != nil {
378 return
379 }
380 for _, task := range tasks {
381 if rel, err := filepath.Rel(absBase, task.FilePath); err == nil {
382 task.FilePath = rel
383 }
384 }
385}
386
387// filterTasksByPhase returns tasks whose phase matches the given value.
388func filterTasksByPhase(tasks []*model.Task, phase string) []*model.Task {

Callers 8

runNextFunction · 0.85
runStatusListFunction · 0.85
runStatusSingleFunction · 0.85
runTracksFunction · 0.85
runSearchFunction · 0.85
scanProjectTasksFunction · 0.85
runGetFunction · 0.85
runListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected