Skip to content

Commit

Permalink
fix(ApiParser): Better elasticsearch module path resolving.
Browse files Browse the repository at this point in the history
It does not work with global installed elasticsearch, eg in Docker
container.

Closes #6
  • Loading branch information
nodkz committed Jul 23, 2017
1 parent 0e38912 commit 1d2235c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ElasticApiParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ export default class ElasticApiParser {
}

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

Expand Down

0 comments on commit 1d2235c

Please sign in to comment.