()
| 57 | } from '../instructions-template'; |
| 58 | |
| 59 | function globalConfigDir(): string { |
| 60 | // XDG_CONFIG_HOME if set, else ~/.config — on every platform, matching |
| 61 | // opencode's own `xdg-basedir` resolution (no Windows special case; #535). |
| 62 | const xdg = process.env.XDG_CONFIG_HOME && process.env.XDG_CONFIG_HOME.trim().length > 0 |
| 63 | ? process.env.XDG_CONFIG_HOME |
| 64 | : path.join(os.homedir(), '.config'); |
| 65 | return path.join(xdg, 'opencode'); |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Pre-#535 installs wrote the global entry to `%APPDATA%/opencode` — a dir |
no test coverage detected