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

Method persist

tui/settings.go:193–203  ·  view source on GitHub ↗

persist writes the current in-memory config back to disk and asks the app to reload so everything reflects the change.

()

Source from the content-addressed store, hash-verified

191// persist writes the current in-memory config back to disk and asks the app
192// to reload so everything reflects the change.
193func (m settingsModel) persist() tea.Cmd {
194 return func() tea.Msg {
195 if err := writeYAML(m.app.opts.ConfigPath, m.app.cfg); err != nil {
196 return statusMsg(fmt.Sprintf("write failed: %v", err))
197 }
198 return tea.Sequence(
199 setStatus("settings saved"),
200 func() tea.Msg { return configReloadMsg{} },
201 )()
202 }
203}

Callers 1

UpdateMethod · 0.95

Calls 3

writeYAMLFunction · 0.85
statusMsgTypeAlias · 0.85
setStatusFunction · 0.85

Tested by

no test coverage detected