chore: copy report script
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
"deploy-frontend": "vercel --cwd apps/frontend --prod --yes",
|
"deploy-frontend": "vercel --cwd apps/frontend --prod --yes",
|
||||||
"eval:run": "pnpm --dir apps/eval run run",
|
"eval:run": "pnpm --dir apps/eval run run",
|
||||||
"eval:review": "pnpm --dir apps/eval run review",
|
"eval:review": "pnpm --dir apps/eval run review",
|
||||||
|
"eval:sync": "node scripts/sync-report.mjs",
|
||||||
"eval:typecheck": "pnpm --dir apps/eval run typecheck"
|
"eval:typecheck": "pnpm --dir apps/eval run typecheck"
|
||||||
},
|
},
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
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)}`);
|
||||||
Reference in New Issue
Block a user