From 62e8ec04b9b6e05f88a9fad9ebb6f6a6c13e1fe9 Mon Sep 17 00:00:00 2001 From: Bram Borggreve Date: Fri, 4 Oct 2024 15:48:23 +0200 Subject: [PATCH] fix: only use the semver version number without a suffix --- src/utils/get-version.ts | 8 ++++---- src/utils/vendor/package-manager.ts | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/utils/get-version.ts b/src/utils/get-version.ts index afcf75c..4f902fd 100644 --- a/src/utils/get-version.ts +++ b/src/utils/get-version.ts @@ -9,16 +9,16 @@ export function getVersion(command: string, regex: RegExp): string | undefined { } export function getVersionAnchor(): string | undefined { - return getVersion('anchor --version', /anchor-cli (.*)/) + return getVersion('anchor --version', /anchor-cli (\d+\.\d+\.\d+)/) } export function getVersionSolana(): string | undefined { - return getVersion('solana --version', /solana-cli (.*)/) + return getVersion('solana --version', /solana-cli (\d+\.\d+\.\d+)/) } export function getVersionRust(): string | undefined { - return getVersion('rustc --version', /rustc (.*)/) + return getVersion('rustc --version', /rustc (\d+\.\d+\.\d+)/) } export function getVersionAvm(): string | undefined { - return getVersion('avm --version', /avm (.*)/) + return getVersion('avm --version', /avm (\d+\.\d+\.\d+)/) } diff --git a/src/utils/vendor/package-manager.ts b/src/utils/vendor/package-manager.ts index b818ee3..7a1ab6e 100644 --- a/src/utils/vendor/package-manager.ts +++ b/src/utils/vendor/package-manager.ts @@ -26,7 +26,6 @@ export function detectInvokedPackageManager(): PackageManager { for (const pkgManager of packageManagers) { if (invoker.path.includes(pkgManager)) { - console.log(`Found ${pkgManager}`) detectedPackageManager = pkgManager break }