fix: respect $XDG_CONFIG_HOME
This commit is contained in:
parent
527f6bf15f
commit
2ea1bff59d
2 changed files with 17 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue