From 79e0e0b0864caadf02660f184325315d58819786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Bene=C5=A1?= Date: Tue, 27 Aug 2024 10:38:03 +0200 Subject: [PATCH] Don't compare missing version --- src/effektManager.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/effektManager.ts b/src/effektManager.ts index 29f0f5f..fede667 100644 --- a/src/effektManager.ts +++ b/src/effektManager.ts @@ -10,12 +10,12 @@ interface InstallationResult { success: boolean; executable?: string; message: string; - version?: string | null; + version?: string; } interface EffektExecutableInfo { path: string; - version: string | null; + version: string; } /** @@ -47,16 +47,12 @@ export class EffektManager { * * @returns a version number like '0.2.2' or '0.25.2.13' or '0.99.99+nightly.rev.abcdef', etc. */ - private async fetchEffektVersion(path: string): Promise { + private async fetchEffektVersion(path: string): Promise { /// Helper function to remove a generic prefix from a string const removePrefix = (value: string, prefix: string) => value.startsWith(prefix) ? value.slice(prefix.length) : value; const versionOutput = await this.execCommand(`"${path}" --version`); - if (versionOutput.trim() === '') { - return null; - } - // TODO: Handle outputs that don't start with the correct prefix? const version = removePrefix(versionOutput.trim(), "Effekt "); // NOTE: the space is important here return version;