fix: respect $XDG_CONFIG_HOME

This commit is contained in:
Romain Bertrand 2026-03-12 15:44:24 +01:00
parent 527f6bf15f
commit 2ea1bff59d
2 changed files with 17 additions and 0 deletions

View file

@ -21,6 +21,9 @@ type HostConfig struct {
}
func GetConfigDir() (string, error) {
if xdgConfigHome := os.Getenv("XDG_CONFIG_HOME"); xdgConfigHome != "" {
return filepath.Join(xdgConfigHome, "fgj"), nil
}
home, err := os.UserHomeDir()
if err != nil {
return "", err