mirror of https://github.com/aminya/setup-cpp
fix: ignore path modification error for MSVC
This commit is contained in:
parent
7092c4b51f
commit
487a88259f
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,6 @@
|
||||||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||||
import { error } from "@actions/core"
|
import { error } from "@actions/core"
|
||||||
import { setupVCVarsall } from "../vcvarsall/vcvarsall"
|
import { setupVCVarsall } from "../vcvarsall/vcvarsall"
|
||||||
import { readFileSync } from "fs"
|
|
||||||
|
|
||||||
type MSVCVersion = "2015" | "2017" | "2019" | string
|
type MSVCVersion = "2015" | "2017" | "2019" | string
|
||||||
|
|
||||||
|
@ -35,9 +34,13 @@ export async function setupMSVC(
|
||||||
VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133"
|
VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133"
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
if (
|
||||||
|
!(e as string | Error)
|
||||||
|
.toString()
|
||||||
|
.includes("Item has already been added. Key in dictionary: 'Path' Key being added: 'PATH'")
|
||||||
|
) {
|
||||||
error(e as string | Error)
|
error(e as string | Error)
|
||||||
const choco_logs = readFileSync(`${process.env.ALLUSERSPROFILE}\\chocolatey\\logs\\chocolatey.log`, "utf8")
|
}
|
||||||
console.log(choco_logs)
|
|
||||||
}
|
}
|
||||||
// run vcvarsall.bat environment variables
|
// run vcvarsall.bat environment variables
|
||||||
setupVCVarsall(VCTargetsPath, arch, toolset, sdk, uwp, spectre)
|
setupVCVarsall(VCTargetsPath, arch, toolset, sdk, uwp, spectre)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { exportVariable } from "@actions/core"
|
import { exportVariable, info } from "@actions/core"
|
||||||
import { existsSync } from "fs"
|
import { existsSync } from "fs"
|
||||||
|
|
||||||
function getArch(arch: string): string {
|
function getArch(arch: string): string {
|
||||||
|
@ -26,6 +26,7 @@ export function setupVCVarsall(
|
||||||
spectre?: boolean
|
spectre?: boolean
|
||||||
) {
|
) {
|
||||||
if (VCTargetsPath !== undefined && existsSync(VCTargetsPath)) {
|
if (VCTargetsPath !== undefined && existsSync(VCTargetsPath)) {
|
||||||
|
info(`Adding ${VCTargetsPath} to PATH`)
|
||||||
exportVariable("VCTargetsPath", VCTargetsPath)
|
exportVariable("VCTargetsPath", VCTargetsPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue