mirror of
https://github.com/SeriousBug/dotfiles
synced 2025-12-07 05:22:34 -06:00
Install gh (GitHub CLI) via Homebrew and prompt for authentication if not already logged in. This enables GitHub automation and CLI workflows during initial setup. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
89 lines
1.8 KiB
Bash
Executable file
89 lines
1.8 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
echo "Setting up dotfiles environment..."
|
|
|
|
# Detect OS
|
|
OS="$(uname -s)"
|
|
|
|
# Check if Homebrew is installed
|
|
if ! command -v brew &> /dev/null; then
|
|
echo "Homebrew is not installed. Please install it first:"
|
|
echo "https://brew.sh"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Updating Homebrew..."
|
|
brew update
|
|
|
|
# Install packages (available on both macOS and Linux)
|
|
PACKAGES=(
|
|
dotter
|
|
fish
|
|
dust
|
|
eza
|
|
gh
|
|
htop
|
|
go
|
|
jq
|
|
lazygit
|
|
neovim
|
|
asdf
|
|
bat
|
|
pandoc
|
|
ripgrep
|
|
zoxide
|
|
zellij
|
|
p7zip
|
|
)
|
|
|
|
echo "Installing packages..."
|
|
for package in "${PACKAGES[@]}"; do
|
|
if brew list "$package" &>/dev/null; then
|
|
echo "✓ $package already installed"
|
|
else
|
|
echo "Installing $package..."
|
|
brew install "$package"
|
|
fi
|
|
done
|
|
|
|
# Install casks on macOS only
|
|
if [[ "$OS" == "Darwin" ]]; then
|
|
echo "Installing macOS-specific casks..."
|
|
|
|
CASKS=(
|
|
font-fira-code-nerd-font
|
|
orbstack
|
|
)
|
|
|
|
for cask in "${CASKS[@]}"; do
|
|
if brew list --cask "$cask" &>/dev/null; then
|
|
echo "✓ $cask already installed"
|
|
else
|
|
echo "Installing $cask..."
|
|
brew install --cask "$cask"
|
|
fi
|
|
done
|
|
else
|
|
echo "Skipping macOS-specific casks (not on macOS)"
|
|
fi
|
|
|
|
# Set up GitHub CLI authentication
|
|
if command -v gh &> /dev/null; then
|
|
if ! gh auth status &>/dev/null; then
|
|
echo ""
|
|
echo "GitHub CLI is installed but not authenticated."
|
|
echo "Please log in to GitHub CLI:"
|
|
gh auth login
|
|
else
|
|
echo "✓ GitHub CLI already authenticated"
|
|
fi
|
|
fi
|
|
|
|
echo "✓ Setup complete!"
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo " 1. Run 'dotter deploy' to deploy your dotfiles"
|
|
echo " 2. Consider setting fish as your default shell: chsh -s \$(which fish)"
|