()
| 32 | * match or it will create a config the plugin can't read. |
| 33 | */ |
| 34 | export function getOpenCodeConfigDir(): string { |
| 35 | const envDir = process.env.OPENCODE_CONFIG_DIR?.trim(); |
| 36 | if (envDir) return envDir; |
| 37 | if (process.platform === "win32") { |
| 38 | return join(homedir(), ".config", "opencode"); |
| 39 | } |
| 40 | const xdgConfig = process.env.XDG_CONFIG_HOME || join(homedir(), ".config"); |
| 41 | return join(xdgConfig, "opencode"); |
| 42 | } |
| 43 | |
| 44 | function findOmoConfig(configDir: string): string | null { |
| 45 | const locations = [ |