mirror of https://github.com/aminya/setup-cpp
fix: inline defaultLLVMVersion
This commit is contained in:
parent
8a16afc589
commit
d2eafaab01
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -22,15 +22,8 @@ let ubuntuVersionCached: number[] | null = null
|
|||
/** Get the default version if passed true or undefined, otherwise return the version itself */
|
||||
export function getVersion(name: string, version: string | undefined) {
|
||||
if (version === "true" || (version === undefined && name in DefaultVersions)) {
|
||||
return DefaultVersions[name]
|
||||
} else {
|
||||
return version ?? ""
|
||||
}
|
||||
}
|
||||
|
||||
export function defaultLLVMVersion(name: string) {
|
||||
if (["llvm", "clangtidy", "clangformat"].includes(name)) {
|
||||
if (process.platform === "linux") {
|
||||
// llvm on linux
|
||||
if (process.platform === "linux" && ["llvm", "clangtidy", "clangformat"].includes(name)) {
|
||||
try {
|
||||
// get the version if not already done
|
||||
ubuntuVersionCached = ubuntuVersionCached ?? ubuntuVersion()
|
||||
|
@ -45,6 +38,9 @@ export function defaultLLVMVersion(name: string) {
|
|||
}
|
||||
}
|
||||
}
|
||||
// anything else
|
||||
return DefaultVersions[name]
|
||||
} else {
|
||||
return version ?? ""
|
||||
}
|
||||
return DefaultVersions[name]
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ function getLinuxUrl(versionGiven: string): string {
|
|||
} else {
|
||||
// default to the maximum version
|
||||
ubuntu = UBUNTU_SUFFIX_MAP[MAX_UBUNTU]
|
||||
warning(`Falling back to LLVM version ${ubuntu} for the Ubuntu.`)
|
||||
warning(`Falling back to LLVM version ${MAX_UBUNTU} ${ubuntu} for the Ubuntu.`)
|
||||
}
|
||||
|
||||
const prefix = "clang+llvm-"
|
||||
|
|
Loading…
Reference in New Issue