Open History to see the last commit
1import { access } from "node:fs/promises";
2import { resolve } from "node:path";
3import { bootstrap } from "./scripts/bootstrap-distilled.mjs";
4
5export 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};