From 93abb9158d08c8174dc58e87010d0ca244e46d73 Mon Sep 17 00:00:00 2001 From: Ruslan Popov Date: Fri, 4 Apr 2025 00:38:10 +0300 Subject: [PATCH] Ensure configuration update --- src/main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.go b/src/main.go index 8509483..c6021ee 100644 --- a/src/main.go +++ b/src/main.go @@ -130,9 +130,13 @@ func updateFiles(filePaths []string, oldVersion, newVersion string) { func updateConfigFile(configPath string, newVersion string) error { cfg, err := ini.Load(configPath) if err != nil { - return err + return fmt.Errorf("failed to load config: %w", err) } - cfg.Section("bumpversion").Key("current_version").SetValue(newVersion) + sec, err := cfg.GetSection("bumpversion") + if err != nil { + return fmt.Errorf("section [bumpversion] not found: %w", err) + } + sec.Key("current_version").SetValue(newVersion) return cfg.SaveTo(configPath) } @@ -225,5 +229,7 @@ func main() { // Обновляем конфигурационный файл if err := updateConfigFile(cfg_name, newVersion); err != nil { log.Printf("Error updating config file: %v", err) + } else { + log.Printf("Config file %s updated to version %s", cfg_name, newVersion) } }