From f73de1b6a8962fdc9eaaf7dcfc006acca5dae5c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aku=20Pietik=C3=A4inen?= Date: Fri, 15 Aug 2025 15:47:16 +0300 Subject: [PATCH] Use correct PATH for homebrew based on architecture Task-number: QTQAINFRA-6903 Change-Id: I1b5f529e8e94a7e609b5be1704ed83f6380f4cc5 Reviewed-by: Ville-Pekka Karhu --- coin/provisioning/common/macos/homebrew.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/coin/provisioning/common/macos/homebrew.sh b/coin/provisioning/common/macos/homebrew.sh index 3afa874a..f412f18a 100755 --- a/coin/provisioning/common/macos/homebrew.sh +++ b/coin/provisioning/common/macos/homebrew.sh @@ -32,8 +32,6 @@ installPkg() { "/tmp/Homebrew-$VERSION.pkg" sudo installer -pkg "/tmp/Homebrew-$VERSION.pkg" -target / - # Add homebrew to PATH - SetEnvVar "PATH" "/opt/homebrew/bin:\$PATH" echo "Homebrew = $VERSION" >> ~/versions.txt } @@ -65,6 +63,14 @@ else installPkg fi +ARCH_TYPE=$(arch) +# Add homebrew to PATH +if [ "$ARCH_TYPE" == "arm64" ]; then + SetEnvVar "PATH" "/opt/homebrew/bin:\$PATH" +else + SetEnvVar "PATH" "/usr/local/bin:\$PATH" +fi + # Disable non-ascii output for homebrew to make logs more readable SetEnvVar "HOMEBREW_NO_COLOR" "1" SetEnvVar "HOMEBREW_NO_EMOJI" "1"