opencode/packages/cli/test/fixture/restart-child.ts
2026-07-05 13:31:19 -04:00

6 lines
261 B
TypeScript

const stateFile = process.argv[2]
const exit = Number(process.argv[3])
const count = (await Bun.file(stateFile).exists()) ? Number(await Bun.file(stateFile).text()) : 0
await Bun.write(stateFile, String(count + 1))
process.exit(exit || (count === 0 ? 75 : 0))