From 2fea25d02d184a8cba00c9feb0a02424a21be833 Mon Sep 17 00:00:00 2001 From: Erik Bershel <110455084+erik-bershel@users.noreply.github.com> Date: Fri, 27 Sep 2024 01:02:50 +0200 Subject: [PATCH] [macOS] Recommended version of `brew shellenv` usage (#10660) Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> --- images/macos/scripts/build/configure-shell.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/images/macos/scripts/build/configure-shell.sh b/images/macos/scripts/build/configure-shell.sh index 92b23409e..0f7643a5c 100644 --- a/images/macos/scripts/build/configure-shell.sh +++ b/images/macos/scripts/build/configure-shell.sh @@ -14,8 +14,6 @@ sudo chsh -s /bin/bash root # Check MacOS architecture and add HOMEBREW PATH to bashrc if [[ $arch == "arm64" ]]; then echo "Adding Homebrew environment to bash" - /opt/homebrew/bin/brew shellenv >> ~/.bashrc - # Workaround for the issue (#10624) with the Homebrew PATH in the bashrc - sed -i '' '/; export PATH;/d' ~/.bashrc - echo 'export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$PATH"' >> ~/.bashrc + # Discussed here: https://github.com/Homebrew/brew/pull/18366 + echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bashrc fi