chore: copy report script
This commit is contained in:
@@ -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