Files
HolodoriCalc/scripts/apply-game-db.mjs
T
dal4segno 07b98db520
Publish GitHub Pages output / publish (push) Successful in 44s
data: switch to recovered game DB and refresh cards and charts
2026-09-29 22:48:08 +09:00

15 lines
826 B
JavaScript

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');