| 1 | import { existsSync } from "node:fs"; |
| 2 | import { resolve } from "node:path"; |
| 3 | import { bootstrap } from "./scripts/bootstrap-distilled.mjs"; |
| 4 | |
| 5 | export const hooks = { |
| 6 | updateConfig(config) { |
| 7 | // pnpm also runs this hook for parallel Turbo tasks. Only bootstrap a |
| 8 | // missing checkout; leave existing worktrees and their Git config alone. |
| 9 | if (!existsSync(resolve(import.meta.dirname, "submodules/distilled/.git"))) { |
| 10 | bootstrap(import.meta.dirname); |
| 11 | } |
| 12 | return config; |
| 13 | }, |
| 14 | }; |