From dd8bc19edf3e530b7259f7775865783ed94ae137 Mon Sep 17 00:00:00 2001 From: Todd Jordan Date: Tue, 16 Jul 2019 01:04:43 -0400 Subject: [PATCH] Filter out missing rev-index files --- lib/api.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/api.js b/lib/api.js index 6b9d3c7..edfe7c4 100644 --- a/lib/api.js +++ b/lib/api.js @@ -45,6 +45,7 @@ async function processDocs(driver, project) { console.log(`Processing ${project} for versions: ${versionsToProcess}`) await versionsToProcess + .filter(version => filterMissingRevs(version, project)) .map(version => readIndexFileForVersion(version, project)) // Fetch all public modules and public classes .map(versionIndexObject => @@ -68,6 +69,17 @@ async function processDocs(driver, project) { } } +function filterMissingRevs(version, libName) { + const emberVersionJSONPath = `./tmp/rev-index/${libName}-${version}.json` + let isIncluded = true + try { + readJsonSync(emberVersionJSONPath) + } catch(e) { + isIncluded = false + } + return isIncluded +} + function readIndexFileForVersion(version, libName) { const emberVersionJSONPath = `./tmp/rev-index/${libName}-${version}.json` console.debug(`OPENING:: ${emberVersionJSONPath}`)