Expose SaveConfig for writing config to disk

This commit is contained in:
Daniel 2023-12-18 17:09:07 +01:00
parent 0607924762
commit 7631b9d28a
2 changed files with 3 additions and 3 deletions

View file

@ -58,10 +58,10 @@ func loadConfig(requireValidConfig bool) error {
return nil return nil
} }
// saveConfig saves the current configuration to file. // SaveConfig saves the current configuration to file.
// It will acquire a read-lock on the global options registry // It will acquire a read-lock on the global options registry
// lock and must lock each option! // lock and must lock each option!
func saveConfig() error { func SaveConfig() error {
optionsLock.RLock() optionsLock.RLock()
defer optionsLock.RUnlock() defer optionsLock.RUnlock()

View file

@ -187,7 +187,7 @@ func setConfigOption(key string, value any, push bool) (err error) {
// finalize change, activate triggers // finalize change, activate triggers
signalChanges() signalChanges()
return saveConfig() return SaveConfig()
} }
// SetDefaultConfigOption sets a single value in the (fallback) default config. // SetDefaultConfigOption sets a single value in the (fallback) default config.