Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/bombshell-dev/playground.
Something went wrong. Try again.
895 B · 19 lines
TypeScript
at main
1234567891011121314151617181920import { $ } from 'bun';import { existsSync } from 'node:fs';import { mkdir, readFile } from 'node:fs/promises';import { GhostwrightError } from '../src/errors.ts';
const root = new URL('..', import.meta.url).pathname, cache = `${root}/.cache/ghostty`, lock = JSON.parse(await readFile(`${root}/ghostty.lock.json`, 'utf8'));await mkdir(`${root}/.cache`, { recursive: true });if (!existsSync(`${cache}/.git`)) await $`git clone --filter=blob:none ${lock.ghostty.repository} ${cache}`;await $`git -C ${cache} fetch --depth=1 origin ${lock.ghostty.commit}`;await $`git -C ${cache} checkout --detach ${lock.ghostty.commit}`;const actual = (await $`git -C ${cache} rev-parse HEAD`.text()).trim();if (actual !== lock.ghostty.commit) throw new GhostwrightError({ code: 'GW_CHECKOUT_MISMATCH', message: `Ghostty checkout mismatch: expected ${lock.ghostty.commit}, got ${actual}`, });