Last active
January 7, 2026 14:55
-
-
Save leeovery/167d8e564abe1d9a7c01e5a57d194952 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| echo "π Dotfiles Bootstrap" | |
| echo "=====================" | |
| echo "" | |
| # 1. Xcode CLI tools | |
| if ! xcode-select -p &> /dev/null; then | |
| echo "π¦ Installing Xcode Command Line Tools..." | |
| xcode-select --install | |
| echo "" | |
| echo "β οΈ Xcode installation started in background." | |
| echo " Once complete, open a NEW terminal and re-run this script." | |
| echo "" | |
| exit 0 | |
| fi | |
| echo "β Xcode Command Line Tools" | |
| # 2. Homebrew | |
| if ! command -v brew &> /dev/null; then | |
| echo "πΊ Installing Homebrew..." | |
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" </dev/tty | |
| eval "$(/opt/homebrew/bin/brew shellenv)" | |
| fi | |
| echo "β Homebrew" | |
| # 3. Modern Bash (bash-toolkit requires 4+) | |
| if [[ "${BASH_VERSINFO[0]}" -lt 4 ]]; then | |
| echo "π¦ Installing Homebrew Bash..." | |
| brew install bash | |
| fi | |
| echo "β Bash 5" | |
| # 4. GitHub CLI | |
| if ! command -v gh &> /dev/null; then | |
| echo "π¦ Installing GitHub CLI..." | |
| brew install gh | |
| fi | |
| echo "β GitHub CLI" | |
| # 5. GitHub auth (required for private repo) | |
| if ! gh auth status &> /dev/null 2>&1; then | |
| echo "" | |
| echo "π GitHub authentication required for private repos..." | |
| echo "" | |
| gh auth login </dev/tty | |
| fi | |
| echo "β GitHub authenticated" | |
| # Export token for Homebrew (needed for private taps) | |
| export HOMEBREW_GITHUB_API_TOKEN=$(gh auth token) | |
| echo "β Homebrew GitHub token set" | |
| # 6. Clone dotfiles | |
| if [[ ! -d "$HOME/.dotfiles" ]]; then | |
| echo "" | |
| echo "π₯ Cloning dotfiles..." | |
| gh repo clone leeovery/dotfiles "$HOME/.dotfiles" | |
| fi | |
| echo "β Dotfiles cloned" | |
| # 7. Run setup | |
| echo "" | |
| echo "π Starting dotfiles setup..." | |
| cd "$HOME/.dotfiles" | |
| /opt/homebrew/bin/bash ./bin/dotsetup install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment