forked from pathikrit/mac-setup-script
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·263 lines (238 loc) · 4.39 KB
/
setup.sh
File metadata and controls
executable file
·263 lines (238 loc) · 4.39 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#!/usr/bin/env bash
brews=(
android-platform-tools
archey
aws-shell
chainsawbaby/formula/bash-snippets
cheat
coreutils
dfc
findutils
fontconfig --universal
fpp
fzf
git
git-extras
git-lfs
gnuplot --with-qt
gnu-sed --with-default-names
go
hh
htop
httpie
iftop
imagemagick --with-webp
lighttpd
lnav
mackup
macvim
mas
micro
moreutils
mtr
ncdu
nmap
node
poppler
postgresql
pgcli
pv
python
python3
osquery
scala
sbt
stormssh
thefuck
tmux
tree
trash
vim --with-override-system-vi
wget --with-iri
)
casks=(
adobe-reader
airdroid
atom
cakebrew
cleanmymac
commander-one
datagrip
docker
dropbox
firefox
geekbench
google-chrome
google-drive
github-desktop
hosts
handbrake
intellij-idea
istat-menus
istat-server
launchrocket
licecap
iterm2
betterzipql
qlcolorcode
qlmarkdown
qlstephen
quicklook-json
quicklook-csv
macdown
microsoft-office
plex-home-theater
plex-media-server
private-eye
satellite-eyes
sidekick
skype
slack
sling
spotify
steam
teleport
transmission
transmission-remote-gui
tunnelbear
visual-studio-code
vlc
volumemixer
webstorm
xquartz
)
pips=(
pip
glances
ohmu
pythonpy
)
gems=(
bundle
)
npms=(
fenix-cli
gitjk
kill-tabs
n
nuclide-installer
)
gpg_key='3E219504'
git_configs=(
"branch.autoSetupRebase always"
"color.ui auto"
"core.autocrlf input"
"core.pager cat"
"credential.helper osxkeychain"
"merge.ff false"
"pull.rebase true"
"push.default simple"
"rebase.autostash true"
"rerere.autoUpdate true"
"rerere.enabled true"
"user.name pathikrit"
"user.email [email protected]"
"user.signingkey ${gpg_key}"
)
apms=(
atom-beautify
circle-ci
ensime
intellij-idea-keymap
language-scala
minimap
)
vscode=(
donjayamanne.python
dragos.scala-lsp
lukehoban.Go
ms-vscode.cpptools
rebornix.Ruby
redhat.java
)
fonts=(
font-source-code-pro
)
######################################## End of app list ########################################
set +e
set -x
function prompt {
read -p "Hit Enter to $1 ..."
}
if test ! $(which brew); then
prompt "Install Xcode"
xcode-select --install
prompt "Install Homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
prompt "Update Homebrew"
brew update
brew upgrade
fi
brew doctor
brew tap homebrew/dupes
function install {
cmd=$1
shift
for pkg in $@;
do
exec="$cmd $pkg"
prompt "Execute: $exec"
if ${exec} ; then
echo "Installed $pkg"
else
echo "Failed to execute: $exec"
fi
done
}
prompt "Update ruby"
ruby -v
brew install gpg
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable
ruby_version='2.6.0'
rvm install ${ruby_version}
rvm use ${ruby_version} --default
ruby -v
sudo gem update --system
prompt "Install Java"
brew cask install java
prompt "Install packages"
brew info ${brews[@]}
install 'brew install' ${brews[@]}
prompt "Install software"
brew tap caskroom/versions
brew cask info ${casks[@]}
install 'brew cask install' ${casks[@]}
prompt "Installing secondary packages"
install 'pip install --upgrade' ${pips[@]}
install 'gem install' ${gems[@]}
install 'npm install --global' ${npms[@]}
install 'apm install' ${apms[@]}
install 'code --install-extension' ${vscode[@]}
brew tap caskroom/fonts
install 'brew cask install' ${fonts[@]}
prompt "Upgrade bash"
brew install bash
sudo bash -c "echo $(brew --prefix)/bin/bash >> /private/etc/shells"
mv ~/.bash_profile ~/.bash_profile_backup
mv ~/.bashrc ~/.bashrc_backup
mv ~/.gitconfig ~/.gitconfig_backup
cd; curl -#L https://github.com/barryclark/bashstrap/tarball/master | tar -xzv --strip-components 1 --exclude={README.md,screenshot.png}
#source ~/.bash_profile
prompt "Set git defaults"
for config in "${git_configs[@]}"
do
git config --global ${config}
done
gpg --keyserver hkp://pgp.mit.edu --recv ${gpg_key}
prompt "Install mac CLI [NOTE: Say NO to bash-completions since we have fzf]!"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/guarinogabriel/mac-cli/master/mac-cli/tools/install)"
prompt "Update packages"
pip3 install --upgrade pip setuptools wheel
mac update
prompt "Cleanup"
brew cleanup
brew cask cleanup
read -p "Run `mackup restore` after DropBox has done syncing ..."
echo "Done!"