mirror of https://github.com/aminya/setup-cpp.git
fix: fix finding the latest gcc installed
This commit is contained in:
parent
8e83c0e114
commit
0fe9cd6e11
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -201,13 +201,13 @@ async function findGccExe(variant: "gcc" | "g++", binDir: string, binVersion: st
|
|||
}
|
||||
|
||||
// try to find the gcc exe in the bin dir
|
||||
const gccExeRegex = new RegExp(`^${escapeRegex(variant)}-?(.*)(\\.exe)?$`)
|
||||
const gccExeRegex = new RegExp(`^${escapeRegex(variant)}-?([\d\.\-]*)(\\.exe)?$`)
|
||||
const files = (await readdir(binDir))
|
||||
.filter((file) => gccExeRegex.test(file))
|
||||
.sort(
|
||||
(exe1, exe2) => {
|
||||
const version1 = exe1.match(gccExeRegex)?.[1] ?? ""
|
||||
const version2 = exe2.match(gccExeRegex)?.[1] ?? ""
|
||||
const version1 = exe1.match(gccExeRegex)![1] ?? ""
|
||||
const version2 = exe2.match(gccExeRegex)![1] ?? ""
|
||||
try {
|
||||
return compareVersion(version1, version2)
|
||||
} catch {
|
||||
|
|
|
|||
Loading…
Reference in New Issue