The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
| 1 | import { access } from "node:fs/promises"; |
| 2 | import { resolve } from "node:path"; |
| 3 | import { bootstrap } from "./scripts/bootstrap-distilled.mjs"; |
| 4 | |
| 5 | export const hooks = { |
| 6 | async updateConfig(config) { |
| 7 | // pnpm also runs this hook for parallel recursive tasks. Only bootstrap a |
| 8 | // missing checkout; leave existing worktrees and their Git config alone. |
| 9 | const checkout = resolve(import.meta.dirname, "submodules/distilled/.git"); |
| 10 | if ( |
| 11 | !(await access(checkout).then( |
| 12 | () => true, |
| 13 | () => false, |
| 14 | )) |
| 15 | ) { |
| 16 | await bootstrap(import.meta.dirname); |
| 17 | } |
| 18 | return config; |
| 19 | }, |
| 20 | }; |