MCPcopy Create free account
hub / github.com/SamNet-dev/snix / writeConfigYAML

Function writeConfigYAML

cmd/snix/wizard.go:313–326  ·  view source on GitHub ↗
(path string, cfg *config.Config)

Source from the content-addressed store, hash-verified

311}
312
313func writeConfigYAML(path string, cfg *config.Config) error {
314 if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
315 return err
316 }
317 f, err := os.Create(path)
318 if err != nil {
319 return err
320 }
321 defer f.Close()
322 enc := yaml.NewEncoder(f)
323 enc.SetIndent(2)
324 defer enc.Close()
325 return enc.Encode(cfg)
326}

Callers 1

runWizardFunction · 0.85

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected