Skip to content

Commit 00fe6df

Browse files
committed
fix: rename isUbuntu to hasAptget
1 parent e10853e commit 00fe6df

File tree

34 files changed

+76
-80
lines changed

34 files changed

+76
-80
lines changed

dist/legacy/setup-cpp.js

Lines changed: 1 addition & 1 deletion
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 & 1 deletion
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: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/modern/setup-cpp.mjs.map

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

src/bazel/bazel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { hasApk, installApkPack } from "setup-alpine"
33
import { addAptKeyViaURL, installAptPack } from "setup-apt"
44
import { installBrewPack } from "setup-brew"
55
import { getDebArch } from "../utils/env/arch.js"
6+
import { hasAptGet } from "../utils/env/hasAptGet.js"
67
import { hasDnf } from "../utils/env/hasDnf.js"
78
import { isArch } from "../utils/env/isArch.js"
8-
import { isUbuntu } from "../utils/env/isUbuntu.js"
99
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
1010
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
1111

@@ -28,7 +28,7 @@ export async function setupBazel(version: string, _setupDir: string, _arch: stri
2828
await setupDnfPack([{ name: "dnf-plugins-core" }])
2929
await execRoot("dnf", ["copr", "enable", "vbatts/bazel"])
3030
return setupDnfPack([{ name: "bazel4" }])
31-
} else if (isUbuntu()) {
31+
} else if (hasAptGet()) {
3232
// https://bazel.build/install/ubuntu
3333
const keyFileName = await addAptKeyViaURL({
3434
fileName: "bazel-archive-keyring.gpg",

src/ccache/ccache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { hasApk, installApkPack } from "setup-alpine"
22
import { installAptPack } from "setup-apt"
33
import { installBrewPack } from "setup-brew"
4+
import { hasAptGet } from "../utils/env/hasAptGet.js"
45
import { hasDnf } from "../utils/env/hasDnf.js"
56
import { isArch } from "../utils/env/isArch.js"
6-
import { isUbuntu } from "../utils/env/isUbuntu.js"
77
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
88
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
99
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
@@ -22,7 +22,7 @@ export async function setupCcache(version: string, _setupDir: string, _arch: str
2222
return setupPacmanPack("ccache", version)
2323
} else if (hasDnf()) {
2424
return setupDnfPack([{ name: "ccache", version }])
25-
} else if (isUbuntu()) {
25+
} else if (hasAptGet()) {
2626
return installAptPack([{ name: "ccache", version }])
2727
} else if (await hasApk()) {
2828
return installApkPack([{ name: "ccache", version }])

src/cppcheck/cppcheck.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { hasApk, installApkPack } from "setup-alpine"
33
import { installAptPack } from "setup-apt"
44
import { installBrewPack } from "setup-brew"
55
import { rcOptions } from "../options.js"
6+
import { hasAptGet } from "../utils/env/hasAptGet.js"
67
import { hasDnf } from "../utils/env/hasDnf.js"
78
import { isArch } from "../utils/env/isArch.js"
8-
import { isUbuntu } from "../utils/env/isUbuntu.js"
99
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
1010
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
1111
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
@@ -26,7 +26,7 @@ export async function setupCppcheck(version: string | undefined, _setupDir: stri
2626
return setupPacmanPack("cppcheck", version)
2727
} else if (hasDnf()) {
2828
return setupDnfPack([{ name: "ccache", version }])
29-
} else if (isUbuntu()) {
29+
} else if (hasAptGet()) {
3030
return installAptPack([{ name: "cppcheck", version }])
3131
} else if (await hasApk()) {
3232
return installApkPack([{ name: "cppcheck", version }])

src/doxygen/doxygen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import { installBrewPack } from "setup-brew"
1010
import { setupGraphviz } from "../graphviz/graphviz.js"
1111
import { rcOptions } from "../options.js"
1212
import { arm64 } from "../utils/env/arch.js"
13+
import { hasAptGet } from "../utils/env/hasAptGet.js"
1314
import { hasDnf } from "../utils/env/hasDnf.js"
1415
import { isArch } from "../utils/env/isArch.js"
15-
import { isUbuntu } from "../utils/env/isUbuntu.js"
1616
import { macosVersion } from "../utils/env/macos_version.js"
1717
import { ubuntuVersion } from "../utils/env/ubuntu_version.js"
1818
import { type PackageInfo, setupBin } from "../utils/setup/setupBin.js"
@@ -109,7 +109,7 @@ async function setupLinuxDoxygen(version: string, setupDir: string, arch: string
109109
return await setupPacmanPack("doxygen", version)
110110
} else if (hasDnf()) {
111111
return setupDnfPack([{ name: "doxygen", version }])
112-
} else if (isUbuntu()) {
112+
} else if (hasAptGet()) {
113113
return await installAptPack([{ name: "doxygen", version, fallBackToLatest: arm64.includes(arch) }])
114114
} else if (await hasApk()) {
115115
return installApkPack([
@@ -125,7 +125,7 @@ async function setupLinuxDoxygen(version: string, setupDir: string, arch: string
125125
// fallback to setupBin if the installation failed
126126
try {
127127
const installationInfo = await setupBin("doxygen", version, getDoxygenPackageInfo, setupDir, arch)
128-
if (isUbuntu()) {
128+
if (hasAptGet()) {
129129
try {
130130
await installAptPack([{ name: "libclang-cpp-dev" }])
131131
} catch (err) {

src/gcc/__tests__/gcc.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { fileURLToPath } from "url"
33
import { execaSync } from "execa"
44
import { chmod } from "fs/promises"
55
import { addExeExt } from "patha"
6-
import { isUbuntu } from "../../utils/env/isUbuntu.js"
6+
import { hasAptGet } from "../../utils/env/hasAptGet.js"
77
import { ubuntuVersion } from "../../utils/env/ubuntu_version.js"
88
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers.js"
99
import { getVersion } from "../../versions/versions.js"
@@ -24,7 +24,7 @@ describe("setup-gcc", () => {
2424
const installInfo = await setupGcc(version, directory, process.arch)
2525

2626
let gpp = "g++"
27-
if (isUbuntu()) {
27+
if (hasAptGet()) {
2828
const ubuntuMajorVersion = ubuntuVersionOutput?.[0]
2929
// https://packages.ubuntu.com/search?keywords=gcc
3030
switch (ubuntuMajorVersion) {

src/gcc/gcc.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import { addUpdateAlternativesToRc, installAptPack } from "setup-apt"
1515
import { installBrewPack } from "setup-brew"
1616
import { setupMacOSSDK } from "../macos-sdk/macos-sdk.js"
1717
import { rcOptions } from "../options.js"
18+
import { hasAptGet } from "../utils/env/hasAptGet.js"
1819
import { hasDnf } from "../utils/env/hasDnf.js"
1920
import { isArch } from "../utils/env/isArch.js"
20-
import { isUbuntu } from "../utils/env/isUbuntu.js"
2121
import type { InstallationInfo } from "../utils/setup/setupBin.js"
2222
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
2323
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
@@ -49,7 +49,7 @@ export async function setupGcc(version: string, setupDir: string, arch: string,
4949
])
5050
} else if (await hasApk()) {
5151
installationInfo = await installApkPack([{ name: "gcc", version }, { name: "g++", version }])
52-
} else if (isUbuntu()) {
52+
} else if (hasAptGet()) {
5353
if (version === "") {
5454
// the default version
5555
installationInfo = await installAptPack([{ name: "gcc" }, { name: "g++" }])
@@ -156,7 +156,7 @@ async function activateGcc(givenVersion: string, binDir: string, priority: numbe
156156
addEnv("CXX", gxxPath, rcOptions),
157157
)
158158

159-
if (isUbuntu()) {
159+
if (hasAptGet()) {
160160
promises.push(
161161
addUpdateAlternativesToRc("cc", gccPath, rcOptions, priority),
162162
addUpdateAlternativesToRc("cxx", gxxPath, rcOptions, priority),

0 commit comments

Comments
 (0)