fix: make shared file sync fail-fast in build script

This commit is contained in:
MacBook
2026-05-01 05:41:07 +02:00
parent 4d489ec992
commit bcbd46d658
+3 -2
View File
@@ -26,9 +26,10 @@ const sharedFiles = ['constants.js', 'blacklist.js'];
for (const file of sharedFiles) {
const src = path.join(masterSharedDir, file);
const dest = path.join(extSharedDir, file);
if (fs.existsSync(src)) {
fs.copyFileSync(src, dest);
if (!fs.existsSync(src)) {
throw new Error(`CRITICAL: Source shared file missing: ${src}. Aborting build to prevent broken artifacts.`);
}
fs.copyFileSync(src, dest);
}
console.log('✓ constants.js and blacklist.js synced to extension/shared/');