Skip to content

Commit c1e22e5

Browse files
committed
fix(config): honor XDG config dir on windows
1 parent ae3688b commit c1e22e5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/config/paths.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import (
1212
const AppName = "gogcli"
1313

1414
func Dir() (string, error) {
15+
if xdg := strings.TrimSpace(os.Getenv("XDG_CONFIG_HOME")); xdg != "" {
16+
return filepath.Join(xdg, AppName), nil
17+
}
18+
1519
base, err := os.UserConfigDir()
1620
if err != nil {
1721
return "", fmt.Errorf("resolve user config dir: %w", err)

0 commit comments

Comments
 (0)