-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
78 lines (61 loc) · 2.3 KB
/
bootstrap.sh
File metadata and controls
78 lines (61 loc) · 2.3 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
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
source scripts/detect-os.sh
# 0) Core deps
if ! command -v stow >/dev/null; then
if [[ "$OS" == "mac" ]]; then
bash scripts/install-brew.sh
brew install stow
fi
if [[ "$OS" == "linux" ]]; then
sudo apt update && sudo apt install -y stow
fi
fi
# 1) Package managers & shells
if [[ "$OS" == "linux" ]]; then
bash scripts/install-apt.sh
fi
# 1.1) Ensure locale en_US.UTF-8 exists (Ubuntu/WSL often missing)
bash scripts/ensure-locale.sh || true
# 1.2) Fonts (shared manifest) — Linux fonts + (if WSL) Windows fonts via PowerShell
# Toggle with DOTFILES_INSTALL_FONTS=0 to skip
INSTALL_FONTS="${DOTFILES_INSTALL_FONTS:-1}"
if [[ "$INSTALL_FONTS" == "1" ]]; then
if [[ "$OS" == "linux" ]]; then
echo "[bootstrap] Installing Linux fonts from fonts/manifest.json ..."
bash scripts/install-fonts-linux.sh || true
if [[ "$WSL" == "1" ]]; then
echo "[bootstrap] Installing Windows fonts from fonts/manifest.json (WSL) ..."
if command -v pwsh.exe >/dev/null 2>&1; then
pwsh.exe -NoProfile -ExecutionPolicy Bypass -File "$(wslpath -w "$PWD/scripts/win/install-fonts.ps1")" || true
elif command -v powershell.exe >/dev/null 2>&1; then
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$(wslpath -w "$PWD/scripts/win/install-fonts.ps1")" || true
else
echo "[bootstrap] Skipping Windows fonts: no pwsh.exe/powershell.exe found."
fi
fi
fi
fi
# 2) Shell: zsh + oh-my-zsh and plugins
bash scripts/ohmyzsh-install.sh || true
# 3) mise (version manager) and activation
bash scripts/install-mise.sh
# 4) Post-mise globals (run inside zsh so .zshrc + omz + mise activation are sourced)
bash scripts/install-mise-globals.sh
# 5) Neovim config via git subtree (pull latest if configured)
bash scripts/nvim-subtree.sh pull --auto || true
# 6) Neovim binary
bash scripts/nvim-manager.sh use stable || true
# 7) Extras
bash scripts/install-lazygit.sh || true
if ! command -v starship >/dev/null; then
curl -fsSL https://starship.rs/install.sh | bash -s -- -y
fi
# 8) Default shell to zsh (if installed)
bash scripts/set-default-shell-zsh.sh || true
# 9) WSL niceties
if [[ "$WSL" == "1" ]]; then
bash scripts/wsl-post.sh || true
fi
echo "Bootstrap complete. Run ./stow-all.sh to link configs."