Skip to content

Filter out missing rev-index files #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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