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' ) ;
2
2
const cmp = require ( 'semver-compare' ) ;
3
3
const semver = require ( 'semver' ) ;
4
4
@@ -85,7 +85,15 @@ module.exports = function () {
85
85
// rare cases when very strange things make it through this far
86
86
// e.g. ember-3.0.0-ember%0A%0ARemove%20after%203.4%20once%20_ENABLE_RENDER_SUPPORT%20flag%20is%20no%20longer%20needed.
87
87
// 🤷♀️
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 ) ;
89
97
}
90
98
91
99
if ( entityData . data . attributes . methods ?. length ) {
You can’t perform that action at this time.
0 commit comments