fix: coerce semver before taking the major

This commit is contained in:
Amin Yahyaabadi 2021-09-16 18:02:18 -05:00
parent 48779980ad
commit b964951e50
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import { setupAptPack } from "../utils/setup/setupAptPack"
import { setupBrewPack } from "../utils/setup/setupBrewPack" import { setupBrewPack } from "../utils/setup/setupBrewPack"
import { setupChocoPack } from "../utils/setup/setupChocoPack" import { setupChocoPack } from "../utils/setup/setupChocoPack"
import semverMajor from "semver/functions/major" import semverMajor from "semver/functions/major"
import semverCoerce from "semver/functions/coerce"
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupGcc(version: string, _setupCppDir: string, arch: string) { 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) { if (binDir !== undefined) {
const majorVersion = semverMajor(version) const majorVersion = semverMajor(semverCoerce(version) ?? version)
// TODO // TODO
// const ld = process.env.LD_LIBRARY_PATH ?? "" // const ld = process.env.LD_LIBRARY_PATH ?? ""