#!/usr/bin/env bash set -euo pipefail echo "Bootstrapping dotfiles..." DOTFILES_DIR="$HOME/dotfiles" if ! command -v brew >/dev/null 2>&1; then echo "Installing Homebrew..." /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" fi if [ -x /opt/homebrew/bin/brew ]; then eval "$(/opt/homebrew/bin/brew shellenv)" fi if ! command -v git &>/dev/null || ! command -v gh &>/dev/null; then echo "Installing git and gh via Homebrew..." HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_ENV_HINTS=1 brew install git gh fi if ! gh auth status &>/dev/null; then echo "Authenticating GitHub CLI... go to https://github.com/login/device on mobile" # defaulting to https and github.com to simplify thing # /dev/null makes it so browser is not needed, otherwise GH_BROWSER=true is the other trick gh auth login --hostname github.com --git-protocol https --web