fix: fix config saving

This commit is contained in:
Maxim Slipenko 2025-02-28 21:14:59 +03:00
parent 29c1a31066
commit 71968bbe13
2 changed files with 5 additions and 1 deletions

@ -193,3 +193,7 @@ func (c *ALRConfig) RootCmd(ctx context.Context) string {
})
return c.cfg.RootCmd
}
func (c *ALRConfig) Save(f *os.File) error {
return toml.NewEncoder(f).Encode(c.cfg)
}

@ -83,7 +83,7 @@ func AddRepoCmd() *cli.Command {
os.Exit(1)
}
err = toml.NewEncoder(cfgFl).Encode(cfg)
err = cfg.Save(cfgFl)
if err != nil {
slog.Error(gotext.Get("Error encoding config"), "err", err)
os.Exit(1)