on main help sign in
fix: fix config paths
e27d15aKujtim Hoxha
internal/config/load.go+4−4
@@ -493,7 +493,7 @@ func hasAWSCredentials(env env.Env) bool {
493func globalConfig() string {
493func globalConfig() string {
494 xdgConfigHome := os.Getenv("XDG_CONFIG_HOME")
494 xdgConfigHome := os.Getenv("XDG_CONFIG_HOME")
495 if xdgConfigHome != "" {
495 if xdgConfigHome != "" {
496− return filepath.Join(xdgConfigHome, "crush")
496+ return filepath.Join(xdgConfigHome, appName, fmt.Sprintf("%s.json", appName))
497 }
497 }
498
498
499 // return the path to the main config directory
499 // return the path to the main config directory
@@ -504,7 +504,7 @@ func globalConfig() string {
504 if localAppData == "" {
504 if localAppData == "" {
505 localAppData = filepath.Join(os.Getenv("USERPROFILE"), "AppData", "Local")
505 localAppData = filepath.Join(os.Getenv("USERPROFILE"), "AppData", "Local")
506 }
506 }
507− return filepath.Join(localAppData, appName)
507+ return filepath.Join(localAppData, appName, fmt.Sprintf("%s.json", appName))
508 }
508 }
509
509
510 return filepath.Join(os.Getenv("HOME"), ".config", appName, fmt.Sprintf("%s.json", appName))
510 return filepath.Join(os.Getenv("HOME"), ".config", appName, fmt.Sprintf("%s.json", appName))
@@ -515,7 +515,7 @@ func globalConfig() string {
515func globalConfigData() string {
515func globalConfigData() string {
516 xdgDataHome := os.Getenv("XDG_DATA_HOME")
516 xdgDataHome := os.Getenv("XDG_DATA_HOME")
517 if xdgDataHome != "" {
517 if xdgDataHome != "" {
518− return filepath.Join(xdgDataHome, appName)
518+ return filepath.Join(xdgDataHome, appName, fmt.Sprintf("%s.json", appName))
519 }
519 }
520
520
521 // return the path to the main data directory
521 // return the path to the main data directory
@@ -526,7 +526,7 @@ func globalConfigData() string {
526 if localAppData == "" {
526 if localAppData == "" {
527 localAppData = filepath.Join(os.Getenv("USERPROFILE"), "AppData", "Local")
527 localAppData = filepath.Join(os.Getenv("USERPROFILE"), "AppData", "Local")
528 }
528 }
529− return filepath.Join(localAppData, appName)
529+ return filepath.Join(localAppData, appName, fmt.Sprintf("%s.json", appName))
530 }
530 }
531
531
532 return filepath.Join(os.Getenv("HOME"), ".local", "share", appName, fmt.Sprintf("%s.json", appName))
532 return filepath.Join(os.Getenv("HOME"), ".local", "share", appName, fmt.Sprintf("%s.json", appName))