-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.sh
More file actions
executable file
·145 lines (122 loc) · 3.23 KB
/
script.sh
File metadata and controls
executable file
·145 lines (122 loc) · 3.23 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/bash
echo "Checking for command line tools..."
if ! xcode-select -p &> /dev/null
then
echo "Installing command line tools..."
xcode-select --install
fi
echo "Installing Brew..."
if ! command -v brew &> /dev/null
then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo >> "$HOME/.zprofile"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> "$HOME/.zprofile"
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
echo "Installing Oh-My-zsh..."
if [ ! -d "$HOME/.oh-my-zsh" ]; then
RUNZSH=no sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
else
echo "Oh-My-zsh already installed."
fi
echo "Installing zsh aliases..."
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cp "$SCRIPT_DIR/config_files/zsh_aliases" "$HOME/.zsh_aliases"
if ! grep -q '\.zsh_aliases' "$HOME/.zshrc" 2>/dev/null; then
echo '' >> "$HOME/.zshrc"
echo '# Load custom aliases' >> "$HOME/.zshrc"
echo '[ -f "$HOME/.zsh_aliases" ] && source "$HOME/.zsh_aliases"' >> "$HOME/.zshrc"
fi
echo "Updating all dependencies..."
brew upgrade
echo "Cleaning up..."
brew cleanup
echo "Installing rbenv..."
if ! command -v rbenv &> /dev/null
then
brew install rbenv
fi
echo "Installing nodenv..."
if ! command -v nodenv &> /dev/null
then
brew install nodenv node-build
nodenv init
eval "$(nodenv init -)"
fi
echo "Installing node..."
if ! command -v node &> /dev/null
then
eval "$(nodenv init -)" 2>/dev/null || true
if command -v nodenv &> /dev/null; then
nodenv install 20
nodenv global 20
else
brew install node
fi
fi
echo "Enabling Corepack and preparing Yarn..."
if command -v node &> /dev/null
then
corepack enable
corepack prepare yarn@stable --activate
fi
echo "Installing redis..."
if ! command -v redis-server &> /dev/null
then
brew install redis
echo "Setting redis auto-start"
ln -sfv "$(brew --prefix redis)"/*.plist "$HOME/Library/LaunchAgents"
fi
echo "Installing heroku cli..."
if ! command -v heroku &> /dev/null
then
brew tap heroku/brew && brew install heroku
fi
echo "Installing gpg..."
if ! command -v gpg &> /dev/null
then
brew install gnupg
fi
if [ ! -d "/Applications/Postgres.app" ]
then
echo "Installing Postgres App..."
brew install --cask postgres-unofficial
fi
if [ ! -d "/Applications/TablePlus.app" ]
then
echo "Installing TablePlus..."
brew install --cask tableplus
fi
if [ ! -d "/Applications/Google Chrome.app" ]
then
echo "Installing Chrome..."
brew install --cask google-chrome
fi
if [ ! -d "/Applications/iTerm.app" ]
then
echo "Installing iTerm2..."
brew install --cask iterm2
fi
if [ ! -d "/Applications/Visual Studio Code.app" ]
then
echo "Installing VSCode..."
brew install --cask visual-studio-code
fi
if [ ! -d "/Applications/Cursor.app" ]
then
echo "Installing Cursor..."
brew install --cask cursor
fi
echo "Copying VSCode config file..."
mkdir -p "$HOME/Library/Application Support/Code/User"
cp config_files/vs_code_settings.json "$HOME/Library/Application Support/Code/User/settings.json"
if [ ! -d "/Applications/Docker.app" ]
then
echo "Installing Docker..."
brew install --cask docker
fi
if [ ! -d "/Applications/Slack.app" ]
then
echo "Installing Slack..."
brew install --cask slack
fi