import { execFileSync } from 'node:child_process'; import { writeFileSync } from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { gameDbRoot, prepareGameDbSource } from './game-db-source.mjs'; const source = prepareGameDbSource(); for (const script of ['collect-game-db.mjs', 'collect-holo-work-achievements.mjs']) { execFileSync(process.execPath, [fileURLToPath(new URL(script, import.meta.url))], { stdio: 'inherit' }); } if (prepareGameDbSource().manifestSha256 !== source.manifestSha256) throw new Error('DB changed during collection'); // Only a successful application advances the review baseline. writeFileSync(path.join(gameDbRoot, 'applied.json'), JSON.stringify({ schemaVersion: 1, snapshot: source.snapshot, manifestSha256: source.manifestSha256 }, null, 2) + '\n');