From 0cd3ad1fae390d91e472aa893f39e66b2eaac920 Mon Sep 17 00:00:00 2001 From: Anton Lazarev Date: Wed, 14 Feb 2024 21:09:50 -0800 Subject: [PATCH] restore the check for missing adblock manifests when packaging Previously, only directories with a `manifest.json` were considered for packaging. Now we look at the list catalog as the source of truth, but we still need to skip components that were not correctly handled in a previous step. This should be rectified later by combining the data-files, manifests, and packaging step into the same pipeline per-component. --- scripts/packageAdBlock.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/packageAdBlock.js b/scripts/packageAdBlock.js index d2d3010d..d1366bfe 100644 --- a/scripts/packageAdBlock.js +++ b/scripts/packageAdBlock.js @@ -54,6 +54,12 @@ const processComponent = (binary, endpoint, region, keyDir, const parsedManifest = util.parseManifest(originalManifest) const id = util.getIDFromBase64PublicKey(parsedManifest.key) + // TODO - previous download failures should prevent the attempt to package the component. + if (!fs.existsSync(originalManifest)) { + console.warn(`Missing manifest for ${componentSubdir}. Skipping.`) + return + } + let fileToHash if (componentSubdir === regionalCatalogComponentId) { fileToHash = 'regional_catalog.json'