Skip to content

Commit d2eafaa

Browse files
committed
fix: inline defaultLLVMVersion
1 parent 8a16afc commit d2eafaa

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/default_versions.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,8 @@ let ubuntuVersionCached: number[] | null = null
2222
/** Get the default version if passed true or undefined, otherwise return the version itself */
2323
export function getVersion(name: string, version: string | undefined) {
2424
if (version === "true" || (version === undefined && name in DefaultVersions)) {
25-
return DefaultVersions[name]
26-
} else {
27-
return version ?? ""
28-
}
29-
}
30-
31-
export function defaultLLVMVersion(name: string) {
32-
if (["llvm", "clangtidy", "clangformat"].includes(name)) {
33-
if (process.platform === "linux") {
25+
// llvm on linux
26+
if (process.platform === "linux" && ["llvm", "clangtidy", "clangformat"].includes(name)) {
3427
try {
3528
// get the version if not already done
3629
ubuntuVersionCached = ubuntuVersionCached ?? ubuntuVersion()
@@ -45,6 +38,9 @@ export function defaultLLVMVersion(name: string) {
4538
}
4639
}
4740
}
41+
// anything else
42+
return DefaultVersions[name]
43+
} else {
44+
return version ?? ""
4845
}
49-
return DefaultVersions[name]
5046
}

src/llvm/llvm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ function getLinuxUrl(versionGiven: string): string {
184184
} else {
185185
// default to the maximum version
186186
ubuntu = UBUNTU_SUFFIX_MAP[MAX_UBUNTU]
187-
warning(`Falling back to LLVM version ${ubuntu} for the Ubuntu.`)
187+
warning(`Falling back to LLVM version ${MAX_UBUNTU} ${ubuntu} for the Ubuntu.`)
188188
}
189189

190190
const prefix = "clang+llvm-"

0 commit comments

Comments
 (0)