fix: print choco logs in case of an error

This commit is contained in:
Amin Yahyaabadi 2021-12-06 05:04:37 -06:00
parent 33870789f0
commit 7092c4b51f
3 changed files with 5 additions and 2 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

@ -1,6 +1,7 @@
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,6 +36,8 @@ export async function setupMSVC(
} }
} catch (e) { } catch (e) {
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)