ghcup-metadata/.github/scripts/brew.sh

29 lines
606 B
Bash

#!/bin/sh
set -eux
# shellcheck disable=SC1091
. .github/scripts/env.sh
if [ -e "$HOME/.brew" ] ; then
(
cd "$HOME/.brew"
git fetch --depth 1
git reset --hard origin/master
)
else
git clone --depth=1 https://github.com/Homebrew/brew "$HOME/.brew"
fi
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
mkdir -p "$CI_PROJECT_DIR/.brew_cache"
export HOMEBREW_CACHE="$CI_PROJECT_DIR/.brew_cache"
mkdir -p "$CI_PROJECT_DIR/.brew_logs"
export HOMEBREW_LOGS="$CI_PROJECT_DIR/.brew_logs"
mkdir -p /private/tmp/.brew_tmp
export HOMEBREW_TEMP=/private/tmp/.brew_tmp
#brew update
brew install ${1+"$@"}