#!/usr/bin/env bash # Bootstrap: installs Homebrew + gh, authenticates with GitHub (2FA), clones # the private personal-config repo, then hands off to setup_mac.sh. # Prerequisites: Install Xcode from the App Store before running this. set -euo pipefail xcode-select -p >/dev/null 2>&1 || { echo "Install Xcode from the App Store first."; exit 1; } command -v brew >/dev/null 2>&1 || \ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" eval "$(/opt/homebrew/bin/brew shellenv 2>/dev/null)" 2>/dev/null || \ eval "$(/usr/local/bin/brew shellenv 2>/dev/null)" command -v gh >/dev/null 2>&1 || brew install gh gh auth status >/dev/null 2>&1 || \ gh auth login --hostname github.com --git-protocol ssh --web REPO="$HOME/.personal-config" [ -d "$REPO/.git" ] \ && git -C "$REPO" pull --ff-only \ || gh repo clone shaunporwal/personal-config "$REPO" exec "$REPO/scripts/setup_mac.sh"