Skip to content

Commit

Permalink
Merge pull request #10 from toddjordan/filter-missing-rev-indices
Browse files Browse the repository at this point in the history
Filter out missing rev-index files
  • Loading branch information
sivakumar-kailasam authored Jul 16, 2019
2 parents 541f63c + dd8bc19 commit 46ad1d6
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 46ad1d6

Please sign in to comment.