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

Function writeGlobalConfigNode

apps/cli/internal/cli/project_registry.go:206–218  ·  view source on GitHub ↗

writeGlobalConfigNode writes the YAML document to the given path.

(path string, doc *yaml.Node)

Source from the content-addressed store, hash-verified

204
205// writeGlobalConfigNode writes the YAML document to the given path.
206func writeGlobalConfigNode(path string, doc *yaml.Node) error {
207 f, err := os.Create(path)
208 if err != nil {
209 return err
210 }
211 defer f.Close()
212 enc := yaml.NewEncoder(f)
213 enc.SetIndent(2)
214 if err := enc.Encode(doc); err != nil {
215 return err
216 }
217 return enc.Close()
218}
219
220// findProjectsSequence locates the "projects" sequence node in the mapping.
221// Returns nil if not found.

Callers 2

registerProjectFunction · 0.85
runProjectUnregisterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected