mirror of https://github.com/aminya/setup-cpp
feat: add setupBrewPack
This commit is contained in:
parent
7fdcafd805
commit
1cad859704
|
@ -0,0 +1,11 @@
|
||||||
|
/* eslint-disable require-atomic-updates */
|
||||||
|
import { exec } from "@actions/exec"
|
||||||
|
|
||||||
|
/** A function that installs a package using brew */
|
||||||
|
export async function setupBrewPack(name: string, version?: string) {
|
||||||
|
const exit = await exec("brew", ["install", version !== undefined ? `${name}@${version}` : name])
|
||||||
|
|
||||||
|
if (exit !== 0) {
|
||||||
|
throw new Error(`Failed to install ${name} ${version}`)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue