Skip to content

Commit 1d2235c

Browse files
committed
fix(ApiParser): Better elasticsearch module path resolving.
It does not work with global installed elasticsearch, eg in Docker container. Closes #6
1 parent 0e38912 commit 1d2235c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ElasticApiParser.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ export default class ElasticApiParser {
123123
}
124124

125125
static findApiVersionFile(version: string): string {
126-
const apiFolder = './node_modules/elasticsearch/src/lib/apis/';
126+
const esModulePath = path.dirname(require.resolve('elasticsearch'));
127+
const apiFolder = `${esModulePath}/lib/apis/`;
127128
const apiListFile = path.resolve(apiFolder, 'index.js');
128129
const apiListCode = ElasticApiParser.loadApiListFile(apiListFile);
129130

0 commit comments

Comments
 (0)