(loc: Location)
| 49 | const TOML_HEADER = 'mcp_servers.codegraph'; |
| 50 | |
| 51 | function configDir(loc: Location): string { |
| 52 | if (loc !== 'global') return path.join(process.cwd(), '.codex'); |
| 53 | // Codex resolves its user layer from `CODEX_HOME` and only falls back to |
| 54 | // `~/.codex` (#1627). Installing to the fallback while Codex reads the |
| 55 | // override is a silent no-op: the files are written, and Codex never looks |
| 56 | // at them. Same resolution the copilot-cli target already does for |
| 57 | // `COPILOT_HOME`. Only the user layer moves — the project layer below is |
| 58 | // anchored to the project, not the profile. |
| 59 | const override = process.env.CODEX_HOME; |
| 60 | if (override && override.trim().length > 0) return override; |
| 61 | return path.join(os.homedir(), '.codex'); |
| 62 | } |
| 63 | function tomlConfigPath(loc: Location): string { |
| 64 | return path.join(configDir(loc), 'config.toml'); |
| 65 | } |
no test coverage detected