Files
Agent-Workbench/docs/live-delivery-v-contract/inputs/scripts/build.mjs
T
2026-11-04 08:54:12 +08:00

9 lines
475 B
JavaScript

import { spawnSync } from 'node:child_process';
import { readFileSync } from 'node:fs';
for (const file of ['src/amount.mjs','src/summary.mjs','src/report.mjs']) {
const result=spawnSync(process.execPath,['--check',file],{encoding:'utf8'});
if(result.status!==0) { process.stderr.write(result.stderr);process.exit(result.status??1); }
if(!readFileSync(file,'utf8').trim()) throw new Error('Empty business module');
}
console.log('All three business modules compile.');