From eaec7086168a138e4a97a53ee8a5b3cdd3d8c358 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 16 Sep 2021 04:20:30 -0500 Subject: [PATCH] fix: make brew synchronous --- src/utils/setup/setupBrewPack.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/utils/setup/setupBrewPack.ts b/src/utils/setup/setupBrewPack.ts index 2b29db13..7eb18ccb 100644 --- a/src/utils/setup/setupBrewPack.ts +++ b/src/utils/setup/setupBrewPack.ts @@ -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" }) }