MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / configDir

Function configDir

src/installer/targets/codex.ts:51–62  ·  view source on GitHub ↗
(loc: Location)

Source from the content-addressed store, hash-verified

49const TOML_HEADER = 'mcp_servers.codegraph';
50
51function 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}
63function tomlConfigPath(loc: Location): string {
64 return path.join(configDir(loc), 'config.toml');
65}

Callers 3

tomlConfigPathFunction · 0.70
instructionsPathFunction · 0.70
detectMethod · 0.70

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected