-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·83 lines (68 loc) · 3.82 KB
/
install.sh
File metadata and controls
executable file
·83 lines (68 loc) · 3.82 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env bash
# install.sh — macOS dotfiles bootstrap
set -e
DOTFILES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
info() { echo "[info] $*"; }
success() { echo "[ok] $*"; }
warn() { echo "[warn] $*"; }
# ── Homebrew ────────────────────────────────────────────────────────────────
if ! command -v brew &>/dev/null; then
info "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"
else
success "Homebrew already installed"
fi
# ── Homebrew packages ────────────────────────────────────────────────────────
info "Installing Homebrew packages..."
brew install \
starship \
zoxide \
zsh-autosuggestions \
zsh-syntax-highlighting
success "Homebrew packages installed"
# ── Symlinks ─────────────────────────────────────────────────────────────────
symlink() {
local src="$1"
local dst="$2"
if [ -e "$dst" ] && [ ! -L "$dst" ]; then
warn "Backing up existing $dst → ${dst}.bak"
mv "$dst" "${dst}.bak"
fi
ln -sf "$src" "$dst"
success "Linked $dst → $src"
}
symlink "$DOTFILES_DIR/zsh/.zshrc" "$HOME/.zshrc"
# ── Git ───────────────────────────────────────────────────────────────────────
symlink "$DOTFILES_DIR/git/.gitconfig" "$HOME/.gitconfig"
symlink "$DOTFILES_DIR/git/.gitignore_global" "$HOME/.gitignore_global"
# ── VSCode ────────────────────────────────────────────────────────────────────
VSCODE_DIR="$HOME/Library/Application Support/Code/User"
if [ -d "$VSCODE_DIR" ]; then
symlink "$DOTFILES_DIR/vscode/settings.json" "$VSCODE_DIR/settings.json"
symlink "$DOTFILES_DIR/vscode/keybindings.json" "$VSCODE_DIR/keybindings.json"
else
warn "VSCode not found — skipping VSCode symlinks"
fi
# ── Ghostty ───────────────────────────────────────────────────────────────────
if [ -d "$HOME/.config/ghostty" ]; then
symlink "$DOTFILES_DIR/ghostty/config" "$HOME/.config/ghostty/config"
else
mkdir -p "$HOME/.config/ghostty"
symlink "$DOTFILES_DIR/ghostty/config" "$HOME/.config/ghostty/config"
fi
# ── Zed ───────────────────────────────────────────────────────────────────────
if [ -d "$HOME/.config/zed" ]; then
symlink "$DOTFILES_DIR/zed/settings.json" "$HOME/.config/zed/settings.json"
else
warn "Zed not found — skipping Zed symlinks"
fi
# ── Done ──────────────────────────────────────────────────────────────────────
echo ""
echo "✓ Done! Reload your shell: source ~/.zshrc"
echo ""
echo "Optional next steps:"
echo " • Install all Homebrew packages from Brewfile: brew bundle"
echo " • Pick a Starship theme: starship preset pastel-powerline -o ~/.config/starship.toml"
echo " • Browse presets: https://starship.rs/presets/"
echo " • Add your Context7 API key to zed/settings.json"