Skip to content

Commit

Permalink
fix: only use the semver version number without a suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Oct 4, 2024
1 parent dfa2fa1 commit 8a74bf7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/get-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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+)/)
}

0 comments on commit 8a74bf7

Please sign in to comment.