feat: move the default versions to the functions themselves

This commit is contained in:
Amin Yahyaabadi 2021-09-16 06:14:06 -05:00
parent 191a15123c
commit 04b70139f6
4 changed files with 7 additions and 5 deletions

View File

@ -17,11 +17,9 @@ inputs:
required: false
cmake:
description: "The cmake version to install."
default: "3.20.2"
required: false
ninja:
description: "The ninja version to install."
default: "1.10.2"
required: false
conan:
description: "The conan version to install."

View File

@ -58,7 +58,9 @@ function getCmakePackageInfo(version: string, platform?: NodeJS.Platform): Packa
}
}
const default_cmake_version = "3.20.2"
/** Setup cmake */
export function setupCmake(version: string, setupCppDir: string): Promise<InstallationInfo> {
return setupBin("cmake", version, getCmakePackageInfo, setupCppDir)
return setupBin("cmake", version === "true" ? default_cmake_version : version, getCmakePackageInfo, setupCppDir)
}

View File

@ -20,7 +20,7 @@ function maybeGetInput(key: string) {
if (value !== "false" && value !== "") {
return value
}
return undefined
return undefined // skip installation
}
export async function main(): Promise<number> {

View File

@ -26,6 +26,8 @@ function getNinjaPackageInfo(version: string, platform: NodeJS.Platform): Packag
}
}
const default_ninja_version = "1.10.2"
export function setupNinja(version: string, setupCppDir: string): Promise<InstallationInfo> {
return setupBin("ninja", version, getNinjaPackageInfo, setupCppDir)
return setupBin("ninja", version === "true" ? default_ninja_version : version, getNinjaPackageInfo, setupCppDir)
}