Skip to content

Commit 17286fc

Browse files
committed
fix: specify the major version for clang-format
1 parent 15f7626 commit 17286fc

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

dist/actions/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/actions/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.

dist/legacy/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/legacy/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.

dist/modern/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/modern/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/llvm/llvm_installer.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function setupLLVMApt(
2323

2424
await setupAptPack([{ name: "curl" }])
2525
await execa("curl", ["-LJO", "https://apt.llvm.org/llvm.sh"], { cwd: "/tmp" })
26-
const neededPackages = await patchAptLLVMScript("/tmp/llvm.sh", "/tmp/llvm-setup-cpp.sh", packages)
26+
const neededPackages = await patchAptLLVMScript("/tmp/llvm.sh", "/tmp/llvm-setup-cpp.sh", majorVersion, packages)
2727
await setupAptPack(neededPackages)
2828
await chmod("/tmp/llvm-setup-cpp.sh", "755")
2929
await execRoot(
@@ -45,12 +45,12 @@ export async function setupLLVMApt(
4545
}
4646
}
4747

48-
async function patchAptLLVMScript(path: string, target_path: string, packages: LLVMPackages) {
48+
async function patchAptLLVMScript(path: string, target_path: string, majorVersion: number, packages: LLVMPackages) {
4949
let script = await readFile(path, "utf-8")
5050

5151
script = debugScript(script)
5252
script = nonInteractiveScript(script)
53-
script = choosePackages(packages, script)
53+
script = choosePackages(packages, script, majorVersion)
5454
script = await removeConflictingPackages(script)
5555
script = useNalaScript(script)
5656

@@ -105,9 +105,9 @@ function useNalaScript(script: string) {
105105
return script
106106
}
107107

108-
function choosePackages(packages: LLVMPackages, script: string) {
108+
function choosePackages(packages: LLVMPackages, script: string, majorVersion: number) {
109109
if (packages === LLVMPackages.ClangFormat) {
110-
return script.replace(/ -y \$PKG/g, " -y clang-format")
110+
return script.replace(/ -y \$PKG/g, ` -y clang-format-${majorVersion}`)
111111
}
112112
return script
113113
}

0 commit comments

Comments
 (0)