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

Function scanAllProjects

apps/cli/internal/cli/all_projects.go:24–47  ·  view source on GitHub ↗

scanAllProjects loads tasks from all registered projects, qualifying IDs. Unreachable projects are skipped with a warning to stderr.

()

Source from the content-addressed store, hash-verified

22// scanAllProjects loads tasks from all registered projects, qualifying IDs.
23// Unreachable projects are skipped with a warning to stderr.
24func scanAllProjects() ([]*ProjectTask, error) {
25 entries, err := LoadGlobalRegistry()
26 if err != nil {
27 return nil, fmt.Errorf("load global registry: %w", err)
28 }
29
30 if len(entries) == 0 {
31 return nil, fmt.Errorf("no projects registered in global registry")
32 }
33
34 var all []*ProjectTask
35 for _, entry := range entries {
36 tasks, err := scanProjectTasks(entry)
37 if err != nil {
38 fmt.Fprintf(os.Stderr, "Warning: skipping project %q: %v\n", entry.ID, err)
39 continue
40 }
41 for _, t := range tasks {
42 all = append(all, &ProjectTask{ProjectID: entry.ID, Task: t})
43 }
44 }
45
46 return all, nil
47}
48
49// injectProjectColumn adds a "project" column after the first column if not already present.
50func injectProjectColumn(columns []string) []string {

Calls 2

LoadGlobalRegistryFunction · 0.85
scanProjectTasksFunction · 0.85