forked from pathikrit/mac-setup-script
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-dev.sh
More file actions
executable file
·247 lines (218 loc) · 3.94 KB
/
Copy pathsetup-dev.sh
File metadata and controls
executable file
·247 lines (218 loc) · 3.94 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
#!/usr/bin/env bash
#Set the versions you want installed and set to default in nvm/rvm
node_version='6.10.0'
ruby_version='2.6.0'
brews=(
autoconf
automake
c-ares
cairo
cask
coreutils
csshx
dirmngr
emacs
fontconfig
freetype
fzf
gcc
gettext
git
git-extras
glib
gmp
gnupg
gnupg2
gpg-agent
isl
jpeg
jq
libassuan
libffi
libgcrypt
libgpg-error
libksba
libmpc
libpng
libtiff
libtool
libusb
libusb-compat
libwebsockets
libyaml
mackup
mosquitto
mpfr
nvm
oniguruma
openssl
pcre
pinentry
pixman
pkg-config
pth
rbenv
readline
ruby-build
unrar
wget
xz
zeromq
zlib
)
casks=(
atom
cyberduck
dropbox
etcher
evernote
flycut
google-chrome
istat-menus
lastpass
omnigraffle
postman
skitch
skype
slack
sourcetree
spectacle
spotify
the-unarchiver
transmission
virtualbox
virtualbox-extension-pack
vlc
)
npms=(
bower
cordova
evrythng
evrythng-extended
gulp
gulp-cli
http-server
ionic
ios-deploy
ios-sim
netlify-cli
typings
webpack
)
git_configs=(
)
apms=(
atom-beautify
atom-bootstrap3
atom-html-preview
auto-update-packages
compare-files
config-import-export
copy-as-rtf
editorconfig
filesize
highlight-selected
hyperclick
js-hyperclick
language-docker
linter
linter-eslint
minimap
script
terminal-plus
tool-bar
tool-bar-almighty
)
######################################## End of app list ########################################
set +e
#set -x
if test ! $(which brew); then
echo "Installing Xcode ..."
xcode-select --install
echo "Installing Homebrew ..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
echo "Updating Homebrew ..."
brew update
brew upgrade
fi
brew doctor
echo "Tapping casks ..."
brew tap caskroom/versions
brew tap homebrew/dupes
brew tap caskroom/cask
fails=()
function print_red {
red='\x1B[0;31m'
NC='\x1B[0m' # no color
echo -e "${red}$1${NC}"
}
function install {
cmd=$1
shift
for pkg in $@;
do
exec="$cmd $pkg"
echo "Executing: $exec"
if $exec ; then
echo "Installed $pkg"
else
fails+=($pkg)
print_red "Failed to execute: $exec"
fi
done
}
echo "Installing ruby ..."
ruby -v
curl -sSL https://get.rvm.io | bash -s stable
rvm install ${ruby_version}
rvm use ${ruby_version} --default
ruby -v
sudo gem update --system
#echo "Installing Java ..."
brew cask install java
echo "Installing packages ..."
brew info ${brews[@]}
install 'brew install' ${brews[@]}
echo "Installing software ..."
brew cask info ${casks[@]}
install 'brew cask install' ${casks[@]}
# TODO: Fix this
#echo "Installing Node ..."
#nvm install ${node_version}
#nvm alias default ${node_version}
#nvm use default
echo "Installing secondary packages ..."
#install 'pip install --upgrade' ${pips[@]}
#install 'gem install' ${gems[@]}
# TODO: Fix this based on nvm above
#install 'npm install --global' ${npms[@]}
install 'apm install' ${apms[@]}
echo "Upgrading 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
#echo "Setting git defaults ..."
#for config in "${git_configs[@]}"
#do
# git config --global ${config}
#done
#gpg --keyserver hkp://pgp.mit.edu --recv ${gpg_key}
echo "Installing mac CLI ..."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/guarinogabriel/mac-cli/master/mac-cli/tools/install)"
echo "Final Updating ..."
pip3 install --upgrade pip setuptools wheel
mac update
echo "Cleaning up ..."
brew cleanup
brew cask cleanup
for fail in ${fails[@]}
do
echo "Failed to install: $fail"
done
echo "Run `mackup restore` after DropBox has done syncing"
echo "Done!"