JS Build: Fix watch exits when encountering an error

This commit is contained in:
Tom Najdek 2024-03-12 17:04:34 +01:00
parent c31a40c749
commit e7f899c09d
No known key found for this signature in database
GPG key ID: EEC61A7B4C667D77

View file

@ -102,6 +102,7 @@ async function processFile(path) {
} }
} }
catch (err) { catch (err) {
onError(err);
result = false; result = false;
} }
return result; return result;
@ -116,7 +117,7 @@ async function processFiles(mutex) {
let t2 = Date.now(); let t2 = Date.now();
let aggrResult; let aggrResult;
if (results.length === 1) { if (results.length === 1 && results[0]) {
onSuccess(results[0]); onSuccess(results[0]);
aggrResult = results[0]; aggrResult = results[0];
} }
@ -140,7 +141,7 @@ async function processFiles(mutex) {
onSuccess(await cleanUp(signatures)); onSuccess(await cleanUp(signatures));
if (shouldAddOmni && aggrResult.outFiles?.length) { if (shouldAddOmni && aggrResult?.outFiles?.length) {
onSuccess(await addOmniFiles(aggrResult.outFiles)); onSuccess(await addOmniFiles(aggrResult.outFiles));
} }
} }