fix: make brew synchronous

This commit is contained in:
Amin Yahyaabadi 2021-09-16 04:20:30 -05:00
parent edbc293b98
commit eaec708616
1 changed files with 3 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/* eslint-disable require-atomic-updates */
import { exec } from "@actions/exec"
import { execFileSync } from "child_process"
import which from "which"
import { setupBrew } from "../../brew/brew"
@ -12,9 +12,6 @@ export async function setupBrewPack(name: string, version?: string) {
hasBrew = true
}
const exit = await exec("brew", ["install", version !== undefined ? `${name}@${version}` : name])
if (exit !== 0) {
throw new Error(`Failed to install ${name} ${version}`)
}
// brew is not thread-safe
execFileSync("brew", ["install", version !== undefined ? `${name}@${version}` : name], { stdio: "inherit" })
}