Skip to content

Commit

Permalink
Fix type mismatch when checking effekt version
Browse files Browse the repository at this point in the history
  • Loading branch information
jiribenes committed Aug 10, 2024
1 parent 048d229 commit b65de10
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/effektManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,10 @@ export class EffektManager {
public async checkAndInstallEffekt(): Promise<string> {
try {
const effektPath = await this.getEffektExecutable();
const currentVersion = await this.execCommand(`"${effektPath}" --version`);
this.effektVersion = semver.clean(currentVersion, true)
if (!this.effektVersion) {
const currentVersion = await this.execCommand(`"${effektPath.path}" --version`);
this.effektVersion = semver.clean(currentVersion, true)
}

const latestVersion = await this.getLatestNPMVersion(this.effektNPMPackage);

Expand All @@ -252,7 +254,7 @@ export class EffektManager {
}

this.updateStatusBar();
return currentVersion;
return this.effektVersion || '';
} catch (error) {
if (error instanceof Error && error.message.includes('Effekt executable not found')) {
const latestVersion = await this.getLatestNPMVersion(this.effektNPMPackage)
Expand Down

0 comments on commit b65de10

Please sign in to comment.