()
| 69 | } from '../instructions-template'; |
| 70 | |
| 71 | function globalConfigDir(): string { |
| 72 | // XDG_CONFIG_HOME if set, else ~/.config — on every platform, matching |
| 73 | // opencode's own `xdg-basedir` resolution (no Windows special case; #535). |
| 74 | const xdg = process.env.XDG_CONFIG_HOME && process.env.XDG_CONFIG_HOME.trim().length > 0 |
| 75 | ? process.env.XDG_CONFIG_HOME |
| 76 | : path.join(os.homedir(), '.config'); |
| 77 | return path.join(xdg, 'opencode'); |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * Pre-#535 installs wrote the global entry to `%APPDATA%/opencode` — a dir |
no test coverage detected