-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·46 lines (38 loc) · 1.36 KB
/
bootstrap.sh
File metadata and controls
executable file
·46 lines (38 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
set -euo pipefail
# Install Xcode Command Line Tools if not already installed
if ! xcode-select -p &>/dev/null; then
echo "Installing Xcode Command Line Tools..."
xcode-select --install
until xcode-select -p &>/dev/null; do
sleep 5
done
fi
# Install Homebrew if not already installed
if ! command -v brew &>/dev/null; then
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# Install applications via Brewfile
if [[ -f ./Brewfile ]]; then
echo "Installing applications from Brewfile..."
brew bundle --file=./Brewfile
else
echo "Warning: Brewfile not found in current directory"
fi
# Install Zap ZSH plugin manager
if [[ ! -d "${XDG_DATA_HOME:-$HOME/.local/share}/zap" ]]; then
echo "Installing Zap ZSH plugin manager..."
zsh <(curl -s https://raw.githubusercontent.com/zap-zsh/zap/master/install.zsh) --branch release-v1
echo "Removing .zshrc so stow can manage it..."
rm -f ~/.zshrc
fi
# Re-source Homebrew env just in case
eval "$(/opt/homebrew/bin/brew shellenv)"
# Use GNU Stow to symlink dotfiles
echo "Setting up dotfiles with GNU Stow..."
stow --target="$HOME" --dir=./dotfiles zsh vim nvim aerospace
# Optionally restart the shell
exec zsh -l