[macos] improve brew caching approach (#8630)

This commit is contained in:
ilia-shipitsin
2023-10-23 09:17:15 +02:00
committed by GitHub
parent 6a98903627
commit 58ccf6762a
3 changed files with 19 additions and 12 deletions

View File

@@ -5,8 +5,8 @@ source ~/utils/utils.sh
arch=$(get_arch)
echo "Installing Homebrew..."
HOMEBREW_INSTALL_URL="https://raw.githubusercontent.com/Homebrew/install/master/install.sh"
/bin/bash -c "$(curl -fsSL ${HOMEBREW_INSTALL_URL})"
download_with_retries "https://raw.githubusercontent.com/Homebrew/install/master/install.sh" "/tmp" "homebrew-install.sh"
/bin/bash /tmp/homebrew-install.sh
if [[ $arch == "arm64" ]]; then
/opt/homebrew/bin/brew update

View File

@@ -7,7 +7,8 @@ source ~/utils/utils.sh
[ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}")
VERSION=$(curl "${authString[@]}" -fsSL https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh | bash
download_with_retries "https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh" "/tmp" "nvm-install.sh"
bash /tmp/nvm-install.sh
if [ $? -eq 0 ]; then
. ~/.bashrc