-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·122 lines (106 loc) · 3.37 KB
/
setup.sh
File metadata and controls
executable file
·122 lines (106 loc) · 3.37 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/bash
set -euo pipefail
# Helper function
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# =============================================================================
# Homebrew
# =============================================================================
echo ""
echo "=== Homebrew ==="
if ! command_exists brew; then
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Set up PATH for this session (needed on Linux and Apple Silicon)
if [[ -f /home/linuxbrew/.linuxbrew/bin/brew ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
elif [[ -f /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
else
echo "Homebrew already installed"
fi
# =============================================================================
# Zsh
# =============================================================================
echo ""
echo "=== Zsh ==="
if ! command_exists zsh; then
echo "Installing zsh..."
if command_exists apt-get; then
sudo apt-get update
sudo apt-get install -y zsh
elif command_exists brew; then
brew install zsh
else
echo "Error: Unable to install zsh. Please install it manually."
exit 1
fi
else
echo "Zsh already installed"
fi
if [[ "$SHELL" != *"zsh"* ]]; then
echo "Setting zsh as default shell..."
chsh -s "$(which zsh)"
else
echo "Zsh is already the default shell"
fi
# =============================================================================
# Stow
# =============================================================================
echo ""
echo "=== Stow ==="
if ! command_exists stow; then
echo "Installing stow..."
if command_exists apt-get; then
sudo apt-get update
sudo apt-get install -y stow
elif command_exists brew; then
brew install stow
else
echo "Error: Unable to install stow. Please install it manually."
exit 1
fi
else
echo "Stow already installed"
fi
# =============================================================================
# NVM (Node Version Manager)
# =============================================================================
echo ""
echo "=== NVM ==="
if [[ ! -d "$HOME/.nvm" ]]; then
echo "Installing NVM..."
/bin/bash -c "$(curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh)"
else
echo "NVM already installed"
fi
# =============================================================================
# PNPM
# =============================================================================
echo ""
echo "=== PNPM ==="
if ! command_exists pnpm; then
echo "Installing PNPM..."
curl -fsSL https://get.pnpm.io/install.sh | ENV="$HOME/.zshrc" SHELL="$(which zsh)" sh -
else
echo "PNPM already installed"
fi
# =============================================================================
# Claude Code
# =============================================================================
echo ""
echo "=== Claude Code ==="
if ! command_exists claude; then
echo "Installing Claude Code..."
curl -fsSL https://claude.ai/install.sh | bash
else
echo "Claude Code already installed"
fi
# =============================================================================
# Done
# =============================================================================
echo ""
echo "=== Setup complete ==="
echo "Run ./install.sh to install packages and apply dotfiles"