fix: fix config saving
This commit is contained in:
parent
29c1a31066
commit
71968bbe13
@ -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)
|
||||
}
|
||||
|
2
repo.go
2
repo.go
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user