Bootstrap Homebrew before git clone in all setup scripts

On a fresh Mac, git is a stub that requires Xcode CLT. The Homebrew
installer handles Xcode CLT automatically, so install Homebrew inline
first, then use git to clone the repo. This fixes the source failure
when step files are not yet available.
This commit is contained in:
cediackermann 2026-04-24 10:20:31 +02:00
parent 8a06384cc1
commit 93d3f67180
3 changed files with 30 additions and 3 deletions

View file

@ -19,8 +19,17 @@ _error() { echo -e "${RED}✗ $1${NC}"; exit 1; }
[[ "$OSTYPE" != "darwin"* ]] && _error "This script is designed for macOS."
# ---------------------------------------------------------------------------
# Clone or update the repo first so step files are available
# Bootstrap: Homebrew first (installs Xcode CLT → git), then clone the repo
# ---------------------------------------------------------------------------
if ! command -v brew &>/dev/null; then
_info "Installing Homebrew (this also installs git via Xcode CLT)..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo >> ~/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
_success "Homebrew installed"
fi
_info "Setting up riotsecure repository..."
if [ -d ~/riotsecure ]; then
_warning "Repository already exists — updating..."

View file

@ -18,8 +18,17 @@ _error() { echo -e "${RED}✗ $1${NC}"; exit 1; }
[[ "$OSTYPE" != "darwin"* ]] && _error "This script is designed for macOS."
# ---------------------------------------------------------------------------
# Clone or update the repo first so step files are available
# Bootstrap: Homebrew first (installs Xcode CLT → git), then clone the repo
# ---------------------------------------------------------------------------
if ! command -v brew &>/dev/null; then
_info "Installing Homebrew (this also installs git via Xcode CLT)..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo >> ~/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
_success "Homebrew installed"
fi
_info "Setting up riotsecure repository..."
if [ -d ~/riotsecure ]; then
_warning "Repository already exists — updating..."

View file

@ -35,8 +35,17 @@ while [[ $# -gt 0 ]]; do
done
# ---------------------------------------------------------------------------
# Clone or update the repo first so step files are available
# Bootstrap: Homebrew first (installs Xcode CLT → git), then clone the repo
# ---------------------------------------------------------------------------
if ! command -v brew &>/dev/null; then
_info "Installing Homebrew (this also installs git via Xcode CLT)..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo >> ~/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
_success "Homebrew installed"
fi
_info "Setting up riotsecure repository..."
if [ -d ~/riotsecure ]; then
_warning "Repository already exists — updating..."