fix: add config load and directory creation

This commit is contained in:
2025-03-22 13:41:41 +03:00
parent 8f4b021a93
commit c705c25613
6 changed files with 38 additions and 21 deletions

View File

@ -171,7 +171,13 @@ func (c *ALRConfig) GetPaths() *Paths {
}
func (c *ALRConfig) initPaths() {
err := os.MkdirAll(c.paths.RepoDir, 0o755)
err := os.MkdirAll(filepath.Dir(c.paths.UserConfigPath), 0o755)
if err != nil {
slog.Error(gotext.Get("Unable to create config directory"), "err", err)
os.Exit(1)
}
err = os.MkdirAll(c.paths.RepoDir, 0o755)
if err != nil {
slog.Error(gotext.Get("Unable to create repo cache directory"), "err", err)
os.Exit(1)