mirror of https://github.com/aminya/setup-cpp
chore: rename setupPackage to setupBin
This commit is contained in:
parent
04dd26cc88
commit
4927f3a272
|
@ -2,7 +2,7 @@ import { extractZip, extractTar } from "@actions/tool-cache"
|
||||||
import { getInput } from "@actions/core"
|
import { getInput } from "@actions/core"
|
||||||
import semverLte from "semver/functions/lte"
|
import semverLte from "semver/functions/lte"
|
||||||
import semverCoerce from "semver/functions/coerce"
|
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 */
|
/** Get the platform data for cmake */
|
||||||
function getCmakePackageInfo(version: string, platform?: NodeJS.Platform): PackageInfo {
|
function getCmakePackageInfo(version: string, platform?: NodeJS.Platform): PackageInfo {
|
||||||
|
@ -60,5 +60,5 @@ function getCmakePackageInfo(version: string, platform?: NodeJS.Platform): Packa
|
||||||
|
|
||||||
/** Setup cmake */
|
/** Setup cmake */
|
||||||
export function setupCmake(version: string, setupCppDir: string): Promise<InstallationInfo> {
|
export function setupCmake(version: string, setupCppDir: string): Promise<InstallationInfo> {
|
||||||
return setupPackage("cmake", version, getCmakePackageInfo, setupCppDir)
|
return setupBin("cmake", version, getCmakePackageInfo, setupCppDir)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { mkdirP } from "@actions/io"
|
||||||
import * as path from "path"
|
import * as path from "path"
|
||||||
import semverLte from "semver/functions/lte"
|
import semverLte from "semver/functions/lte"
|
||||||
import { isValidUrl } from "../utils/http/validate_url"
|
import { isValidUrl } from "../utils/http/validate_url"
|
||||||
import { InstallationInfo, PackageInfo, setupPackage } from "../utils/setup/setupBin"
|
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||||
|
|
||||||
//================================================
|
//================================================
|
||||||
// Version
|
// Version
|
||||||
|
@ -298,7 +298,7 @@ export async function setupLLVM(version: string, directoryGiven?: string): Promi
|
||||||
|
|
||||||
directory = path.resolve(directory)
|
directory = path.resolve(directory)
|
||||||
|
|
||||||
const installationInfo = await setupPackage("llvm", version, getLLVMPackageInfo, directory)
|
const installationInfo = await setupBin("llvm", version, getLLVMPackageInfo, directory)
|
||||||
|
|
||||||
// Adding environment variables
|
// Adding environment variables
|
||||||
const lib = path.join(directory, "lib")
|
const lib = path.join(directory, "lib")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { extractZip } from "@actions/tool-cache"
|
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 */
|
/** Get the platform name Ninja uses in their download links */
|
||||||
function getNinjaPlatform(platform: NodeJS.Platform) {
|
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> {
|
export function setupNinja(version: string, setupCppDir: string): Promise<InstallationInfo> {
|
||||||
return setupPackage("ninja", version, getNinjaPackageInfo, setupCppDir)
|
return setupBin("ninja", version, getNinjaPackageInfo, setupCppDir)
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ export type InstallationInfo = {
|
||||||
*
|
*
|
||||||
* @returns The installation directory
|
* @returns The installation directory
|
||||||
*/
|
*/
|
||||||
export async function setupPackage(
|
export async function setupBin(
|
||||||
name: string,
|
name: string,
|
||||||
version: string,
|
version: string,
|
||||||
getPackageInfo: (version: string, platform: NodeJS.Platform) => PackageInfo | Promise<PackageInfo>,
|
getPackageInfo: (version: string, platform: NodeJS.Platform) => PackageInfo | Promise<PackageInfo>,
|
||||||
|
|
Loading…
Reference in New Issue