diff --git a/src/Config/CliInfo.ts b/src/Config/CliInfo.ts index 2b17f78e..52c47b1b 100644 --- a/src/Config/CliInfo.ts +++ b/src/Config/CliInfo.ts @@ -7,13 +7,13 @@ export class CliInfo { public readonly version: string; public readonly distribution: string | undefined; - constructor(cwd: string = process.cwd()) { + constructor(cwd: string) { const packagePath = this.getPackagePath(cwd); const packageData = this.getPackageData(packagePath); this.cwd = packagePath ? path.dirname(packagePath) : cwd; this.version = process.env.VERSION ?? packageData?.version; - this.distribution = packageData.brightCli?.distribution; + this.distribution = packageData?.brightCli?.distribution; } private getPackageData(packagePath: string) { diff --git a/src/Config/container.ts b/src/Config/container.ts index 0464bb82..8dd86a76 100644 --- a/src/Config/container.ts +++ b/src/Config/container.ts @@ -64,7 +64,9 @@ container .register('tsyringe', { useValue: container }) - .register(CliInfo, { useValue: new CliInfo(process.cwd()) }) + .register(CliInfo, { + useValue: new CliInfo(__dirname) + }) .register( RequestExecutor, {