Skip to content

Commit 39b3e75

Browse files
committed
feat: bootstrap Xcode CLT and Homebrew on fresh macOS
Custom install scripts now auto-install prerequisites: - Xcode Command Line Tools (provides git) - Homebrew (package manager)
1 parent 464daf8 commit 39b3e75

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

src/hooks.server.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,41 @@ echo " Config: @${username}/${slug}"
1010
echo "========================================"
1111
echo ""
1212
13+
install_xcode_clt() {
14+
if xcode-select -p &>/dev/null; then
15+
return 0
16+
fi
17+
echo "Installing Xcode Command Line Tools..."
18+
echo "(A dialog may appear - please click 'Install')"
19+
echo ""
20+
xcode-select --install 2>/dev/null || true
21+
echo "Waiting for Xcode Command Line Tools installation..."
22+
until xcode-select -p &>/dev/null; do
23+
sleep 5
24+
done
25+
echo "Xcode Command Line Tools installed!"
26+
echo ""
27+
}
28+
29+
install_homebrew() {
30+
if command -v brew &>/dev/null; then
31+
return 0
32+
fi
33+
echo "Installing Homebrew..."
34+
echo ""
35+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
36+
if [ "$(uname -m)" = "arm64" ]; then
37+
eval "$(/opt/homebrew/bin/brew shellenv)"
38+
else
39+
eval "$(/usr/local/bin/brew shellenv)"
40+
fi
41+
echo "Homebrew installed!"
42+
echo ""
43+
}
44+
45+
install_xcode_clt
46+
install_homebrew
47+
1348
ARCH="$(uname -m)"
1449
if [ "$ARCH" = "arm64" ]; then
1550
ARCH="arm64"

0 commit comments

Comments
 (0)