From 4927f3a2722cca3ea62db14e9d1b74027a8e886b Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 14 Sep 2021 11:41:13 -0500 Subject: [PATCH] chore: rename setupPackage to setupBin --- src/cmake/cmake.ts | 4 ++-- src/llvm/llvm.ts | 4 ++-- src/ninja/ninja.ts | 4 ++-- src/utils/setup/setupBin.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cmake/cmake.ts b/src/cmake/cmake.ts index 3109288a..9ae31115 100644 --- a/src/cmake/cmake.ts +++ b/src/cmake/cmake.ts @@ -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 { - return setupPackage("cmake", version, getCmakePackageInfo, setupCppDir) + return setupBin("cmake", version, getCmakePackageInfo, setupCppDir) } diff --git a/src/llvm/llvm.ts b/src/llvm/llvm.ts index 7665442a..37e5ed72 100644 --- a/src/llvm/llvm.ts +++ b/src/llvm/llvm.ts @@ -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") diff --git a/src/ninja/ninja.ts b/src/ninja/ninja.ts index e938f0ef..dddad01d 100644 --- a/src/ninja/ninja.ts +++ b/src/ninja/ninja.ts @@ -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 { - return setupPackage("ninja", version, getNinjaPackageInfo, setupCppDir) + return setupBin("ninja", version, getNinjaPackageInfo, setupCppDir) } diff --git a/src/utils/setup/setupBin.ts b/src/utils/setup/setupBin.ts index ffc96b9c..753d89dd 100644 --- a/src/utils/setup/setupBin.ts +++ b/src/utils/setup/setupBin.ts @@ -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,