on main help sign in
fix: rethink global config path on windows: use `$HOME/.config` (#1352)
commit927221886008fcf0aae0fdd681b4575c962edd78 authorAndrey Nering <andreynering@users.noreply.github.com> dateMon 3 Nov 2025, 13:43 (1 year ago) parentac80175
2 files changed+1−12
README.md+1−1 internal/config/load.go−11
README.md+1−1
@@ -211,7 +211,7 @@ or globally, with the following priority:
211211
2122121. `.crush.json`
2132132. `crush.json`
214−3. `$HOME/.config/crush/crush.json` (Windows: `%USERPROFILE%\AppData\Local\crush\crush.json`)
214+3. `$HOME/.config/crush/crush.json`
215215
216216Configuration itself is stored as a JSON object:
217217
internal/config/load.go−11
@@ -662,17 +662,6 @@ func GlobalConfig() string {
662662 return filepath.Join(xdgConfigHome, appName, fmt.Sprintf("%s.json", appName))
663663 }
664664
665− // return the path to the main config directory
666− // for windows, it should be in `%LOCALAPPDATA%/crush/`
667− // for linux and macOS, it should be in `$HOME/.config/crush/`
668− if runtime.GOOS == "windows" {
669− localAppData := os.Getenv("LOCALAPPDATA")
670− if localAppData == "" {
671− localAppData = filepath.Join(os.Getenv("USERPROFILE"), "AppData", "Local")
672− }
673− return filepath.Join(localAppData, appName, fmt.Sprintf("%s.json", appName))
674− }
675−
676665 return filepath.Join(home.Dir(), ".config", appName, fmt.Sprintf("%s.json", appName))
677666}
678667