Skip to content

Commit

Permalink
Filter out missing rev-index files
Browse files Browse the repository at this point in the history
  • Loading branch information
toddjordan committed Jul 16, 2019
1 parent 541f63c commit dd8bc19
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand All @@ -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}`)
Expand Down

0 comments on commit dd8bc19

Please sign in to comment.