feat: add default version for msvc

This commit is contained in:
Amin Yahyaabadi 2021-09-16 06:17:38 -05:00
parent 04b70139f6
commit b55bf22468
2 changed files with 6 additions and 3 deletions

View File

@ -121,7 +121,7 @@ export async function main(): Promise<number> {
// setup brew // setup brew
const brewVersion = maybeGetInput("brew") const brewVersion = maybeGetInput("brew")
if (brewVersion !== undefined) { if (brewVersion !== undefined) {
await setupBrew() setupBrew()
} }
// setup ccache // setup ccache

View File

@ -4,7 +4,7 @@ import { exportVariable } from "@actions/core"
import { existsSync } from "fs" import { existsSync } from "fs"
import { arch as osArch } from "os" import { arch as osArch } from "os"
type MSVCVersion = "2015" | "2017" | "2019" | string type MSVCVersion = "2015" | "2017" | "2019" | "true" | string
function getArch(arch: string): string { function getArch(arch: string): string {
switch (arch) { switch (arch) {
@ -22,13 +22,16 @@ function getArch(arch: string): string {
} }
} }
const default_msvc_version = "2019"
export async function setupMSVC( export async function setupMSVC(
version: MSVCVersion, versionGiven: MSVCVersion,
sdk?: string, sdk?: string,
uwp?: boolean, uwp?: boolean,
spectre?: boolean, spectre?: boolean,
arch = osArch() arch = osArch()
): Promise<void> { ): Promise<void> {
const version = versionGiven === "true" ? default_msvc_version : versionGiven
if (process.platform !== "win32") { if (process.platform !== "win32") {
return return
} }