fancive_obsidian-parallel-r.../scripts/check-build-artifacts.mjs
wujunchen 2364e62911 chore: check build artifact consistency
Change-Id: I485ee9ef2eaf584a1c1fcf890ee85fb82a34a8fb
2026-04-26 18:22:11 +08:00

19 lines
553 B
JavaScript

import { execFileSync } from 'node:child_process';
function diffMainJs() {
return execFileSync('git', ['diff', '--', 'main.js'], { encoding: 'utf8' });
}
const before = diffMainJs();
execFileSync('npm', ['run', 'build'], { stdio: 'inherit' });
const after = diffMainJs();
if (after !== before) {
console.error('\nmain.js is not in sync with the TypeScript source.');
console.error('Run `npm run build` and include the updated main.js in the same change.');
process.exit(1);
}
console.log('main.js is in sync with the TypeScript source.');