| 81 | } |
| 82 | |
| 83 | func findDefaultConfigPathForOS(goos string) (string, bool) { |
| 84 | const windowsOS = "windows" |
| 85 | configPath := filepath.Join(getConfigDirForOS(goos), "config.yml") |
| 86 | if _, err := os.Stat(configPath); err == nil { |
| 87 | return configPath, true |
| 88 | } |
| 89 | |
| 90 | if goos == windowsOS { |
| 91 | xdgPath := filepath.Join(getXDGBaseConfigDir(), "pvetui", "config.yml") |
| 92 | if _, err := os.Stat(xdgPath); err == nil { |
| 93 | return xdgPath, true |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | // Check for config in current directory |
| 98 | if _, err := os.Stat("config.yml"); err == nil { |
| 99 | return "config.yml", true |
| 100 | } |
| 101 | |
| 102 | return "", false |
| 103 | } |
| 104 | |
| 105 | // getConfigDir returns the appropriate config directory path for the current platform. |
| 106 | func getConfigDir() string { |