From b964951e50de23eae74893eefd1edcaeb0ad5c92 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 16 Sep 2021 18:02:18 -0500 Subject: [PATCH] fix: coerce semver before taking the major --- src/gcc/gcc.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gcc/gcc.ts b/src/gcc/gcc.ts index e4f8056f..1722b549 100644 --- a/src/gcc/gcc.ts +++ b/src/gcc/gcc.ts @@ -4,6 +4,7 @@ import { setupAptPack } from "../utils/setup/setupAptPack" import { setupBrewPack } from "../utils/setup/setupBrewPack" import { setupChocoPack } from "../utils/setup/setupChocoPack" import semverMajor from "semver/functions/major" +import semverCoerce from "semver/functions/coerce" // eslint-disable-next-line @typescript-eslint/no-unused-vars export async function setupGcc(version: string, _setupCppDir: string, arch: string) { @@ -50,7 +51,7 @@ export async function setupGcc(version: string, _setupCppDir: string, arch: stri } } if (binDir !== undefined) { - const majorVersion = semverMajor(version) + const majorVersion = semverMajor(semverCoerce(version) ?? version) // TODO // const ld = process.env.LD_LIBRARY_PATH ?? ""