Merge pull request #89 from aminya/cppcheck [skip ci]

This commit is contained in:
Amin Yahyaabadi 2022-05-30 12:45:56 -07:00 committed by GitHub
commit e3d2d1fc9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 4 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,6 @@ const DefaultVersions: Record<string, string> = {
task: "3.12.1", // https://github.com/go-task/task/releases
doxygen: process.platform === "darwin" ? "1.9.3" : "1.9.4", // https://www.doxygen.nl/download.html // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=doxygen
gcc: "11", // https://github.com/brechtsanders/winlibs_mingw/releases and // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=gcc
cppcheck: process.platform === "win32" ? "2.7" : "",
}
/// If an ubuntu versions is not in this map:

View File

@ -5,6 +5,7 @@ import { setupChocolatey } from "../../chocolatey/chocolatey"
import { InstallationInfo } from "./setupBin"
import execa from "execa"
import { info } from "@actions/core"
import { notice } from "../io/io"
let hasChoco = false
@ -32,7 +33,16 @@ export async function setupChocoPack(name: string, version?: string, args: strin
stdio: "inherit",
})
} else {
execa.sync("choco", ["install", "-y", name, ...args], { env, extendEnv: false, stdio: "inherit" })
try {
execa.sync("choco", ["install", "-y", name, ...args], { env, extendEnv: false, stdio: "inherit" })
} catch (err) {
// if the package requires a reboot, downgrade the error to a notice
if ((err as Error).message.includes("exit code 3010")) {
notice(`${name} might require a reboot for the completion of the installation.`)
} else {
throw err
}
}
}
const binDir = `${process.env.ChocolateyInstall ?? "C:/ProgramData/chocolatey"}/bin`