From 871dd2e3743f006c2ac70376f8494f31a8e4948f Mon Sep 17 00:00:00 2001 From: Hein Date: Fri, 2 Jan 2026 22:51:19 +0200 Subject: [PATCH] feat(config): :sparkles: Add SaveConfig method to persist configuration --- pkg/config/manager.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/config/manager.go b/pkg/config/manager.go index 016c6bf..07cc324 100644 --- a/pkg/config/manager.go +++ b/pkg/config/manager.go @@ -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