Skip to content

Commit 5f08fa6

Browse files
committed
fix for missing files
1 parent 7fd26fe commit 5f08fa6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

prember-urls.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { readdirSync } = require('fs');
1+
const { readdirSync, existsSync } = require('fs');
22
const cmp = require('semver-compare');
33
const semver = require('semver');
44

@@ -85,7 +85,15 @@ module.exports = function () {
8585
// rare cases when very strange things make it through this far
8686
// e.g. ember-3.0.0-ember%0A%0ARemove%20after%203.4%20once%20_ENABLE_RENDER_SUPPORT%20flag%20is%20no%20longer%20needed.
8787
// 🤷‍♀️
88-
entityData = require(`${__dirname}/ember-api-docs-data/json-docs/${p}/${highestPatchVersion}/${entity}/${fileName}.json`);
88+
const requirePath = `${__dirname}/ember-api-docs-data/json-docs/${p}/${highestPatchVersion}/${entity}/${fileName}.json`;
89+
if (!existsSync(requirePath)) {
90+
// TODO we really shouldn't come across this so we should investigate why there are things in the rev-index that don't have corresponding files
91+
console.log(
92+
`about to require ${requirePath} but that file doesn't exist`
93+
);
94+
return;
95+
}
96+
entityData = require(requirePath);
8997
}
9098

9199
if (entityData.data.attributes.methods?.length) {

0 commit comments

Comments
 (0)