From 8a74bf70fbfc31ffc558a16dc7b000b1c67b3422 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 ++++---- 1 file changed, 4 insertions(+), 4 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+)/) }