9 lines
475 B
JavaScript
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.');
|