From e08ce49f0702828b58c4a079ea3a253e42c9ce52 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 15 Sep 2021 03:21:28 -0500 Subject: [PATCH] chore: rename functions for clarification --- src/conan/conan.ts | 4 ++-- src/gcovr/gcovr.ts | 4 ++-- src/meson/meson.ts | 4 ++-- src/utils/setup/{setupApt.ts => setupAptPack.ts} | 2 +- src/utils/setup/{setupChoco.ts => setupChocoPack.ts} | 2 +- src/utils/setup/{setupPip.ts => setupPipPack.ts} | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) rename src/utils/setup/{setupApt.ts => setupAptPack.ts} (76%) rename src/utils/setup/{setupChoco.ts => setupChocoPack.ts} (88%) rename src/utils/setup/{setupPip.ts => setupPipPack.ts} (90%) diff --git a/src/conan/conan.ts b/src/conan/conan.ts index 1c14af45..224cf681 100644 --- a/src/conan/conan.ts +++ b/src/conan/conan.ts @@ -1,5 +1,5 @@ -import { setupPip } from "../utils/setup/setupPip" +import { setupPipPack } from "../utils/setup/setupPipPack" export async function setupConan(version?: string) { - await setupPip("conan", version) + await setupPipPack("conan", version) } diff --git a/src/gcovr/gcovr.ts b/src/gcovr/gcovr.ts index c6f6c240..93347e0a 100644 --- a/src/gcovr/gcovr.ts +++ b/src/gcovr/gcovr.ts @@ -1,5 +1,5 @@ -import { setupPip } from "../utils/setup/setupPip" +import { setupPipPack } from "../utils/setup/setupPipPack" export async function setupGcovr(version?: string) { - await setupPip("gcovr", version) + await setupPipPack("gcovr", version) } diff --git a/src/meson/meson.ts b/src/meson/meson.ts index 41db0272..6fbf6ac4 100644 --- a/src/meson/meson.ts +++ b/src/meson/meson.ts @@ -1,5 +1,5 @@ -import { setupPip } from "../utils/setup/setupPip" +import { setupPipPack } from "../utils/setup/setupPipPack" export async function setupMeson(version?: string) { - await setupPip("meson", version) + await setupPipPack("meson", version) } diff --git a/src/utils/setup/setupApt.ts b/src/utils/setup/setupAptPack.ts similarity index 76% rename from src/utils/setup/setupApt.ts rename to src/utils/setup/setupAptPack.ts index 613224dc..5af2d8be 100644 --- a/src/utils/setup/setupApt.ts +++ b/src/utils/setup/setupAptPack.ts @@ -1,7 +1,7 @@ import { exec } from "@actions/exec" /** A function that installs a package using apt */ -export async function setupApt(name: string, version?: string, updateRepositories: boolean = true) { +export async function setupAptPack(name: string, version?: string, updateRepositories: boolean = true) { if (updateRepositories) { await exec("apt-get", ["update"]) } diff --git a/src/utils/setup/setupChoco.ts b/src/utils/setup/setupChocoPack.ts similarity index 88% rename from src/utils/setup/setupChoco.ts rename to src/utils/setup/setupChocoPack.ts index 07fdcd0b..9d6ec262 100644 --- a/src/utils/setup/setupChoco.ts +++ b/src/utils/setup/setupChocoPack.ts @@ -3,7 +3,7 @@ import which from "which" import { setupChocolatey } from "../../chocolatey/chocolatey" /** A function that installs a package using choco */ -export async function setupChoco(name: string, version?: string) { +export async function setupChocoPack(name: string, version?: string) { if (which.sync("choco", { nothrow: true }) === null) { await setupChocolatey() } diff --git a/src/utils/setup/setupPip.ts b/src/utils/setup/setupPipPack.ts similarity index 90% rename from src/utils/setup/setupPip.ts rename to src/utils/setup/setupPipPack.ts index 784cec27..5f9358d0 100644 --- a/src/utils/setup/setupPip.ts +++ b/src/utils/setup/setupPipPack.ts @@ -3,7 +3,7 @@ import which from "which" import { addPath, startGroup, endGroup } from "@actions/core" /** A function that installs a package using pip */ -export async function setupPip(name: string, version?: string) { +export async function setupPipPack(name: string, version?: string) { // check if it exists const pip = which.sync("pip3", { nothrow: true }) !== null ? "pip3" : "pip"