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

Function nodeToProjectEntry

apps/cli/internal/cli/project_registry.go:247–263  ·  view source on GitHub ↗
(node *yaml.Node)

Source from the content-addressed store, hash-verified

245}
246
247func nodeToProjectEntry(node *yaml.Node) GlobalProjectEntry {
248 var entry GlobalProjectEntry
249 if node.Kind != yaml.MappingNode {
250 return entry
251 }
252 for i := 0; i < len(node.Content)-1; i += 2 {
253 switch node.Content[i].Value {
254 case "id":
255 entry.ID = node.Content[i+1].Value
256 case "name":
257 entry.Name = node.Content[i+1].Value
258 case "path":
259 entry.Path = node.Content[i+1].Value
260 }
261 }
262 return entry
263}
264
265func checkDuplicateID(doc *yaml.Node, id string) error {
266 entries := extractProjectEntries(doc)

Callers 2

extractProjectEntriesFunction · 0.85
removeProjectNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected