File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1- const { readdirSync } = require ( 'fs' ) ;
1+ const { readdirSync, existsSync } = require ( 'fs' ) ;
22const cmp = require ( 'semver-compare' ) ;
33const 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 ) {
You can’t perform that action at this time.
0 commit comments