Repository navigation
Expand file tree
/
Copy pathinstall.sh
More file actions
103 lines (89 loc) · 2.9 KB
/
Copy pathinstall.sh
File metadata and controls
103 lines (89 loc) · 2.9 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
set -uo pipefail
# Pre-flight: ensure Terminal has App Management permission.
# System Settings → Privacy & Security → App Management → enable Terminal.
# Without this, some casks (mactex, fonts) may fail to install.
echo "==> Step 1: Homebrew"
if ! command -v brew >/dev/null 2>&1; then
echo "Installing Homebrew..."
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if ! command -v /opt/homebrew/bin/brew >/dev/null 2>&1; then
echo "Error: Homebrew installation failed" >&2
exit 1
fi
eval "$(/opt/homebrew/bin/brew shellenv)"
else
echo "Homebrew already installed"
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
echo "==> Step 2: brew bundle"
if ! brew bundle --verbose --file=./Brewfile; then
echo "Warning: Some Homebrew formulae or casks may have failed to install" >&2
echo "Check output above for details. Continuing anyway..." >&2
fi
echo "==> Step 3: stow dotfiles"
mkdir -p ~/.config
if [ -f ~/.zprofile ] && [ ! -L ~/.zprofile ]; then
echo "Backing up existing ~/.zprofile to ~/.zprofile.bak"
mv ~/.zprofile ~/.zprofile.bak
fi
if ! stow --no-folding home; then
echo "Error: stow failed" >&2
exit 1
fi
echo "==> Step 4: Install fisher"
if ! fish -c 'type -q fisher' 2>/dev/null; then
echo "Installing fisher..."
fish -c 'curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher'
else
echo "fisher already installed"
fi
echo "==> Step 5: Install fish plugins"
fish -c 'fisher install'
echo "==> Step 6: Configure Tide prompt"
fish -c 'tide configure --auto --style=Classic \
--prompt_colors="True color" \
--classic_prompt_color=Dark \
--show_time="24-hour format" \
--classic_prompt_separators=Angled \
--powerline_prompt_heads=Sharp \
--powerline_prompt_tails=Flat \
--powerline_prompt_style="Two lines, character" \
--prompt_connection=Disconnected \
--powerline_right_prompt_frame=No \
--prompt_spacing=Sparse \
--icons="Many icons" \
--transient=No'
echo "==> Step 7: Smoke test"
if command -v fish >/dev/null 2>&1; then
echo "✓ fish is installed"
else
echo "✗ fish is NOT installed"
fi
if [ -L "$HOME/.config/fish/conf.d/general.fish" ]; then
echo "✓ stow symlinks exist"
else
echo "✗ stow symlinks do NOT exist"
fi
if [ -L "$HOME/.zprofile" ]; then
echo "✓ ~/.zprofile is linked"
else
echo "✗ ~/.zprofile is NOT linked"
fi
if fish -c 'type -q fisher' 2>/dev/null; then
echo "✓ fisher is available"
else
echo "✗ fisher is NOT available"
fi
if command -v mise >/dev/null 2>&1; then
echo "✓ mise is available"
else
echo "✗ mise is NOT available"
fi
if [ -L "$HOME/Library/Application Support/com.mitchellh.ghostty/config" ]; then
echo "✓ Ghostty config is linked"
else
echo "✗ Ghostty config is NOT linked"
fi
echo ""
echo "Bootstrap complete!"