MCPcopy Create free account
hub / github.com/cortexkit/magic-context / withHome

Function withHome

packages/pi-plugin/src/config/index.test.ts:19–27  ·  view source on GitHub ↗
(home: string)

Source from the content-addressed store, hash-verified

17}
18
19function withHome(home: string): void {
20 process.env.HOME = home;
21 // The user config base is `(XDG_CONFIG_HOME ?? <HOME>/.config)/cortexkit/...`.
22 // writeUserConfig() writes under `<HOME>/.config`, so pin XDG_CONFIG_HOME to
23 // match — otherwise a CI runner that exports its own XDG_CONFIG_HOME makes the
24 // loader look elsewhere and these tests read schema defaults (the green-on-my-
25 // machine / red-in-CI hermeticity gap this guards against).
26 process.env.XDG_CONFIG_HOME = join(home, ".config");
27}
28
29function writeConfig(path: string, text: string): void {
30 mkdirSync(join(path, ".."), { recursive: true });

Callers 1

index.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected