Files

19 lines
740 B
JavaScript

import { copyFileSync, existsSync, mkdirSync } from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const src = path.join(root, 'apps', 'eval', 'out', 'report.json');
const destDir = path.join(root, 'apps', 'web', 'static');
const dest = path.join(destDir, 'report.json');
if (!existsSync(src)) {
console.error(`[sync-report] Not found: ${src}`);
console.error('Run the eval first (pnpm eval:run / eval:review) to produce an out/report.json.');
process.exit(1);
}
mkdirSync(destDir, { recursive: true });
copyFileSync(src, dest);
console.log(`[sync-report] ${path.relative(root, src)} -> ${path.relative(root, dest)}`);