feat: add setupBrewPack

This commit is contained in:
Amin Yahyaabadi 2021-09-16 03:21:04 -05:00
parent 7fdcafd805
commit 1cad859704
1 changed files with 11 additions and 0 deletions

View File

@ -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}`)
}
}