mirror of https://github.com/aminya/setup-cpp.git
feat: install bash for alpine
This commit is contained in:
parent
3108fdcf8d
commit
5a0bbafcb2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,6 @@
|
|||
export * from "./apk-repository.js"
|
||||
export * from "./has-apk.js"
|
||||
export * from "./init-apt.js"
|
||||
export * from "./install-package.js"
|
||||
export * from "./qualify-install.js"
|
||||
export * from "./update.js"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
import { defaultExecOptions, execRootSync } from "admina"
|
||||
import memoize from "memoizee"
|
||||
import { filterAndQualifyApkPackages } from "./qualify-install.js"
|
||||
import { updateApkMemoized } from "./update.js"
|
||||
|
||||
/** Install bash (usually missing from docker containers) */
|
||||
export async function initApk() {
|
||||
// Update the repos
|
||||
await updateApkMemoized()
|
||||
|
||||
const toInstall = await filterAndQualifyApkPackages([
|
||||
{ name: "bash" },
|
||||
])
|
||||
|
||||
if (toInstall.length !== 0) {
|
||||
execRootSync("apk", ["add", ...toInstall], {
|
||||
...defaultExecOptions,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/** Install bash (usually missing from docker containers) (memoized) */
|
||||
export const initApkMemoized = memoize(initApk, { promise: true })
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import { execRoot } from "admina"
|
||||
import { info, warning } from "ci-log"
|
||||
import { hasApk } from "./has-apk.js"
|
||||
import { initApkMemoized } from "./init-apt.js"
|
||||
import { type ApkPackage, filterAndQualifyApkPackages, formatPackageWithVersion } from "./qualify-install.js"
|
||||
import { updateApkMemoized } from "./update.js"
|
||||
|
||||
|
|
@ -38,6 +39,9 @@ export async function installApkPackage(packages: ApkPackage[], update = false):
|
|||
// Update the repos if needed
|
||||
await updateApkMemoized()
|
||||
|
||||
// init the apk
|
||||
await initApkMemoized()
|
||||
|
||||
const packagesToInstall = await filterAndQualifyApkPackages(packages)
|
||||
|
||||
if (packagesToInstall.length === 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue