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

Function loadWorklogInfo

apps/cli/internal/cli/get.go:119–141  ·  view source on GitHub ↗
(task *model.Task, scanDir string)

Source from the content-addressed store, hash-verified

117}
118
119func loadWorklogInfo(task *model.Task, scanDir string) *worklogInfo {
120 // Resolve the worklog path relative to the scan directory
121 // since task.FilePath may be relative after makeFilePathsRelative
122 taskAbsPath := filepath.Join(scanDir, task.FilePath)
123 wlPath := worklog.WorklogPath(taskAbsPath, task.ID)
124 if !worklog.Exists(wlPath) {
125 return nil
126 }
127
128 wl, err := worklog.ParseWorklog(wlPath)
129 if err != nil || len(wl.Entries) == 0 {
130 return nil
131 }
132
133 info := &worklogInfo{
134 EntryCount: len(wl.Entries),
135 }
136
137 last := wl.Entries[len(wl.Entries)-1]
138 info.LastUpdated = last.Timestamp.Format("2006-01-02T15:04:05Z07:00")
139
140 return info
141}
142
143// dependencyInfo holds resolved dependency information for display.
144type dependencyInfo struct {

Callers 1

runGetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected