mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-01-07 04:14:26 +00:00
feat(config): ✨ Add SaveConfig method to persist configuration
This commit is contained in:
@@ -122,6 +122,14 @@ func (m *Manager) Set(key string, value interface{}) {
|
||||
m.v.Set(key, value)
|
||||
}
|
||||
|
||||
// SaveConfig writes the current configuration to the specified path
|
||||
func (m *Manager) SaveConfig(path string) error {
|
||||
if err := m.v.WriteConfigAs(path); err != nil {
|
||||
return fmt.Errorf("failed to save config to %s: %w", path, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// setDefaults sets default configuration values
|
||||
func setDefaults(v *viper.Viper) {
|
||||
// Server defaults
|
||||
|
||||
Reference in New Issue
Block a user