Skip to content

Commit 6f1d3cd

Browse files
committed
fix: add setup-options for all setup functions
1 parent bb0daa4 commit 6f1d3cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+309
-220
lines changed

dist/legacy/setup-cpp.js

Lines changed: 31 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.mjs

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

dist/modern/setup-cpp.mjs.map

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bazel/__tests__/bazel.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe("setup-bazel", () => {
1111
return
1212
}
1313
it("should setup bazel", async () => {
14-
const installInfo = await setupBazel("", "", process.arch)
14+
const installInfo = await setupBazel({ version: "", setupDir: "", arch: process.arch })
1515

1616
await testBin("bazel", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
1717
})

src/bazel/bazel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { execRoot } from "admina"
22
import { hasApk, installApkPack } from "setup-alpine"
33
import { addAptKeyViaURL, hasAptGet, installAptPack } from "setup-apt"
44
import { installBrewPack } from "setup-brew"
5+
import type { SetupOptions } from "../setup-options.js"
56
import { getDebArch } from "../utils/env/arch.js"
67
import { hasDnf } from "../utils/env/hasDnf.js"
78
import { isArch } from "../utils/env/isArch.js"
89
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
910
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
1011

11-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
12-
export async function setupBazel(version: string, _setupDir: string, _arch: string) {
12+
export async function setupBazel({ version }: SetupOptions) {
1313
switch (process.platform) {
1414
case "win32": {
1515
// install bazelisk because it contains both

src/ccache/__tests__/ccache.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { setupCcache } from "../ccache.js"
55
jest.setTimeout(300000)
66
describe("setup-ccache", () => {
77
it("should setup ccache", async () => {
8-
const installInfo = await setupCcache("", "", process.arch)
8+
const installInfo = await setupCcache({ version: "", setupDir: "", arch: process.arch })
99

1010
await testBin("ccache", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
1111
})

src/ccache/ccache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { hasApk, installApkPack } from "setup-alpine"
22
import { hasAptGet, installAptPack } from "setup-apt"
33
import { installBrewPack } from "setup-brew"
4+
import type { SetupOptions } from "../setup-options.js"
45
import { hasDnf } from "../utils/env/hasDnf.js"
56
import { isArch } from "../utils/env/isArch.js"
67
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
78
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
89
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
910

10-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
11-
export async function setupCcache(version: string, _setupDir: string, _arch: string) {
11+
export async function setupCcache({ version }: SetupOptions) {
1212
switch (process.platform) {
1313
case "win32": {
1414
return setupChocoPack("ccache", version)

src/chocolatey/__tests__/chocolatey.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe("setup-chocolatey", () => {
99
return
1010
}
1111
it("should setup chocolatey", async () => {
12-
const { binDir } = (await setupChocolatey("", "", process.arch)) as InstallationInfo
12+
const { binDir } = (await setupChocolatey({ version: "", setupDir: "", arch: process.arch })) as InstallationInfo
1313
await testBin("choco", ["--version"], binDir)
1414
})
1515
})

src/chocolatey/chocolatey.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,13 @@ import { execaSync } from "execa"
44
import { pathExists } from "path-exists"
55
import which from "which"
66
import { rcOptions } from "../options.js"
7+
import type { SetupOptions } from "../setup-options.js"
78
import type { InstallationInfo } from "../utils/setup/setupBin.js"
89

910
/* eslint-disable require-atomic-updates */
1011
let binDir: string | undefined
1112

12-
export async function setupChocolatey(
13-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
14-
_version: string,
15-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
16-
_setupDir: string,
17-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
18-
_arch: string,
19-
): Promise<InstallationInfo | undefined> {
13+
export async function setupChocolatey(_opts?: SetupOptions): Promise<InstallationInfo | undefined> {
2014
if (process.platform !== "win32") {
2115
return undefined
2216
}

0 commit comments

Comments
 (0)