Skip to content

Commit 98415a3

Browse files
committed
fix(cli): Resolve the CLI CalmHub plugin relative to the CLI directory
1 parent 842eb5d commit 98415a3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

shared/src/consts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
export const CALM_META_SCHEMA_DIRECTORY = __dirname + '/calm';
1+
export const CALM_META_SCHEMA_DIRECTORY = __dirname + '/calm';
2+
export const CALM_AUTH_PLUGIN_DIRECTORY = __dirname + '/plugins';

shared/src/document-loader/calmhub-custom-document-loader.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { execFileSync } from 'child_process';
22
import { SchemaDirectory } from '../schema-directory';
33
import { CalmDocumentType, DocumentLoader, CALM_HUB_PROTO } from './document-loader';
44
import { initLogger, Logger } from '../logger';
5+
import path from 'path';
6+
import {CALM_AUTH_PLUGIN_DIRECTORY} from "../consts";
57

68
export class CalmHubCustomDocumentLoader implements DocumentLoader {
79
private readonly logger: Logger;
@@ -10,9 +12,10 @@ export class CalmHubCustomDocumentLoader implements DocumentLoader {
1012

1113
constructor(private calmHubUrl: string, calmHubWrapper: string, debug: boolean) {
1214
this.baseURL = calmHubUrl;
13-
this.wrapper = calmHubWrapper;
15+
this.wrapper = path.resolve(CALM_AUTH_PLUGIN_DIRECTORY, calmHubWrapper);
1416
this.logger = initLogger(debug, 'calmhub-custom-document-loader');
1517
this.logger.info('Configuring CALMHub custom document loader with base URL: ' + calmHubUrl);
18+
this.logger.info('Configuring CALMHub custom document loader with plugin: ' + this.wrapper);
1619
}
1720

1821
async initialise(_: SchemaDirectory): Promise<void> {

0 commit comments

Comments
 (0)