Skip to content

Commit e3d2d1f

Browse files
authored
Merge pull request #89 from aminya/cppcheck [skip ci]
2 parents 4b1ffd8 + cdc356e commit e3d2d1f

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const DefaultVersions: Record<string, string> = {
1717
task: "3.12.1", // https://github.com/go-task/task/releases
1818
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
1919
gcc: "11", // https://github.com/brechtsanders/winlibs_mingw/releases and // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=gcc
20-
cppcheck: process.platform === "win32" ? "2.7" : "",
2120
}
2221

2322
/// If an ubuntu versions is not in this map:

src/utils/setup/setupChocoPack.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { setupChocolatey } from "../../chocolatey/chocolatey"
55
import { InstallationInfo } from "./setupBin"
66
import execa from "execa"
77
import { info } from "@actions/core"
8+
import { notice } from "../io/io"
89

910
let hasChoco = false
1011

@@ -32,7 +33,16 @@ export async function setupChocoPack(name: string, version?: string, args: strin
3233
stdio: "inherit",
3334
})
3435
} else {
35-
execa.sync("choco", ["install", "-y", name, ...args], { env, extendEnv: false, stdio: "inherit" })
36+
try {
37+
execa.sync("choco", ["install", "-y", name, ...args], { env, extendEnv: false, stdio: "inherit" })
38+
} catch (err) {
39+
// if the package requires a reboot, downgrade the error to a notice
40+
if ((err as Error).message.includes("exit code 3010")) {
41+
notice(`${name} might require a reboot for the completion of the installation.`)
42+
} else {
43+
throw err
44+
}
45+
}
3646
}
3747

3848
const binDir = `${process.env.ChocolateyInstall ?? "C:/ProgramData/chocolatey"}/bin`

0 commit comments

Comments
 (0)