Add failsafe to ensure pdf.js build worked

This commit is contained in:
Abe Jellinek 2026-03-02 17:46:05 -05:00
parent a7c76e3202
commit b6ffa16893

View file

@ -41,6 +41,9 @@ async function getReader(signatures) {
}
await exec('npm ci', { cwd: modulePath });
await exec('npm run build:zotero', { cwd: modulePath });
if (!fs.pathExists(path.join(modulePath, 'build', 'zotero', 'pdf', 'build', 'pdf.mjs'))) {
throw new Error('pdf.js build failed to produce output');
}
await fs.copy(path.join(modulePath, 'build', 'zotero'), targetDir);
}
signatures['reader'] = { hash };