MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / Save

Function Save

internal/config/config.go:74–88  ·  view source on GitHub ↗

Save writes the config to .chief/config.yaml.

(baseDir string, cfg *Config)

Source from the content-addressed store, hash-verified

72
73// Save writes the config to .chief/config.yaml.
74func Save(baseDir string, cfg *Config) error {
75 path := configPath(baseDir)
76
77 // Ensure directory exists
78 if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
79 return err
80 }
81
82 data, err := yaml.Marshal(cfg)
83 if err != nil {
84 return err
85 }
86
87 return os.WriteFile(path, data, 0o644)
88}

Callers 4

handleSettingsKeysMethod · 0.92
handleSettingsGHCheckMethod · 0.92
runTUIWithOptionsFunction · 0.92
TestSaveAndLoadFunction · 0.85

Calls 1

configPathFunction · 0.85

Tested by 1

TestSaveAndLoadFunction · 0.68