Skip to content

Commit

Permalink
Expose SaveConfig for writing config to disk
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Dec 18, 2023
1 parent 0607924 commit 7631b9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config/persistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ func loadConfig(requireValidConfig bool) error {
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
// lock and must lock each option!
func saveConfig() error {
func SaveConfig() error {
optionsLock.RLock()
defer optionsLock.RUnlock()

Expand Down
2 changes: 1 addition & 1 deletion config/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func setConfigOption(key string, value any, push bool) (err error) {
// finalize change, activate triggers
signalChanges()

return saveConfig()
return SaveConfig()
}

// SetDefaultConfigOption sets a single value in the (fallback) default config.
Expand Down

0 comments on commit 7631b9d

Please sign in to comment.