Skip to content

Commit 2f0abd1

Browse files
committed
fix: ignore path modification error for MSVC
1 parent 7092c4b commit 2f0abd1

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
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/msvc/msvc.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ export async function setupMSVC(
3535
VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133"
3636
}
3737
} catch (e) {
38-
error(e as string | Error)
39-
const choco_logs = readFileSync(`${process.env.ALLUSERSPROFILE}\\chocolatey\\logs\\chocolatey.log`, "utf8")
40-
console.log(choco_logs)
38+
if (
39+
!(e as string | Error)
40+
.toString()
41+
.includes("Item has already been added. Key in dictionary: 'Path' Key being added: 'PATH'")
42+
) {
43+
error(e as string | Error)
44+
}
4145
}
4246
// run vcvarsall.bat environment variables
4347
setupVCVarsall(VCTargetsPath, arch, toolset, sdk, uwp, spectre)

src/vcvarsall/vcvarsall.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { exportVariable } from "@actions/core"
1+
import { exportVariable, info } from "@actions/core"
22
import { existsSync } from "fs"
33

44
function getArch(arch: string): string {
@@ -26,6 +26,7 @@ export function setupVCVarsall(
2626
spectre?: boolean
2727
) {
2828
if (VCTargetsPath !== undefined && existsSync(VCTargetsPath)) {
29+
info(`Adding ${VCTargetsPath} to PATH`)
2930
exportVariable("VCTargetsPath", VCTargetsPath)
3031
}
3132

0 commit comments

Comments
 (0)