| 17 | } |
| 18 | |
| 19 | function 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 | |
| 29 | function writeConfig(path: string, text: string): void { |
| 30 | mkdirSync(join(path, ".."), { recursive: true }); |