chore: rename setupPackage to setupBin

This commit is contained in:
Amin Yahyaabadi 2021-09-14 11:41:13 -05:00
parent 04dd26cc88
commit 4927f3a272
4 changed files with 7 additions and 7 deletions

View File

@ -2,7 +2,7 @@ import { extractZip, extractTar } from "@actions/tool-cache"
import { getInput } from "@actions/core"
import semverLte from "semver/functions/lte"
import semverCoerce from "semver/functions/coerce"
import { setupPackage, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"
import { setupBin, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"
/** Get the platform data for cmake */
function getCmakePackageInfo(version: string, platform?: NodeJS.Platform): PackageInfo {
@ -60,5 +60,5 @@ function getCmakePackageInfo(version: string, platform?: NodeJS.Platform): Packa
/** Setup cmake */
export function setupCmake(version: string, setupCppDir: string): Promise<InstallationInfo> {
return setupPackage("cmake", version, getCmakePackageInfo, setupCppDir)
return setupBin("cmake", version, getCmakePackageInfo, setupCppDir)
}

View File

@ -4,7 +4,7 @@ import { mkdirP } from "@actions/io"
import * as path from "path"
import semverLte from "semver/functions/lte"
import { isValidUrl } from "../utils/http/validate_url"
import { InstallationInfo, PackageInfo, setupPackage } from "../utils/setup/setupBin"
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
//================================================
// Version
@ -298,7 +298,7 @@ export async function setupLLVM(version: string, directoryGiven?: string): Promi
directory = path.resolve(directory)
const installationInfo = await setupPackage("llvm", version, getLLVMPackageInfo, directory)
const installationInfo = await setupBin("llvm", version, getLLVMPackageInfo, directory)
// Adding environment variables
const lib = path.join(directory, "lib")

View File

@ -1,5 +1,5 @@
import { extractZip } from "@actions/tool-cache"
import { setupPackage, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"
import { setupBin, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"
/** Get the platform name Ninja uses in their download links */
function getNinjaPlatform(platform: NodeJS.Platform) {
@ -27,5 +27,5 @@ function getNinjaPackageInfo(version: string, platform: NodeJS.Platform): Packag
}
export function setupNinja(version: string, setupCppDir: string): Promise<InstallationInfo> {
return setupPackage("ninja", version, getNinjaPackageInfo, setupCppDir)
return setupBin("ninja", version, getNinjaPackageInfo, setupCppDir)
}

View File

@ -34,7 +34,7 @@ export type InstallationInfo = {
*
* @returns The installation directory
*/
export async function setupPackage(
export async function setupBin(
name: string,
version: string,
getPackageInfo: (version: string, platform: NodeJS.Platform) => PackageInfo | Promise<PackageInfo>,