mirror of https://github.com/aminya/setup-cpp
fix: calculate tools using Object.keys + fix linting for python-pygments
This commit is contained in:
parent
73a098f0c6
commit
d2f3163daf
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
38
src/main.ts
38
src/main.ts
|
@ -80,35 +80,7 @@ const setups = {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The tools that can be installed */
|
/** The tools that can be installed */
|
||||||
const tools: Array<keyof typeof setups> = [
|
const tools = Object.keys(setups) as Array<keyof typeof setups>
|
||||||
"nala",
|
|
||||||
"choco",
|
|
||||||
"brew",
|
|
||||||
"python",
|
|
||||||
"powershell",
|
|
||||||
"vcpkg",
|
|
||||||
"bazel",
|
|
||||||
"cmake",
|
|
||||||
"ninja",
|
|
||||||
"conan",
|
|
||||||
"meson",
|
|
||||||
"gcovr",
|
|
||||||
"opencppcoverage",
|
|
||||||
"ccache",
|
|
||||||
"doxygen",
|
|
||||||
"graphviz",
|
|
||||||
"cppcheck",
|
|
||||||
"clangtidy",
|
|
||||||
"clangformat",
|
|
||||||
"llvm",
|
|
||||||
"gcc",
|
|
||||||
"msvc",
|
|
||||||
"vcvarsall",
|
|
||||||
"kcov",
|
|
||||||
"make",
|
|
||||||
"task",
|
|
||||||
"sevenzip",
|
|
||||||
]
|
|
||||||
|
|
||||||
/** The possible inputs to the program */
|
/** The possible inputs to the program */
|
||||||
export type Inputs = keyof typeof setups | "compiler" | "architecture"
|
export type Inputs = keyof typeof setups | "compiler" | "architecture"
|
||||||
|
@ -158,14 +130,10 @@ export async function main(args: string[]): Promise<number> {
|
||||||
|
|
||||||
let hasLLVM = false // used to unset CPPFLAGS of LLVM when other compilers are used as the main compiler
|
let hasLLVM = false // used to unset CPPFLAGS of LLVM when other compilers are used as the main compiler
|
||||||
|
|
||||||
// install python-pygments to avoid conflicts with cppcheck and gcovr on arch linux
|
if (isArch() && typeof opts.cppcheck === "string" && typeof opts.gcovr === "string") {
|
||||||
if (process.platform === "linux") {
|
info("installing python-pygments to avoid conflicts with cppcheck and gcovr on Arch linux")
|
||||||
if (isArch()) {
|
|
||||||
if (opts.cppcheck && opts.gcovr) {
|
|
||||||
setupPacmanPack("python-pygments")
|
setupPacmanPack("python-pygments")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// loop over the tools and run their setup function
|
// loop over the tools and run their setup function
|
||||||
for (const tool of tools) {
|
for (const tool of tools) {
|
||||||
|
|
Loading…
Reference in New Issue