-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathkaishi-mac
executable file
·229 lines (173 loc) · 5.34 KB
/
kaishi-mac
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
#!/usr/bin/env bash
# This is the kaishi script for setting up your laptop with the
# full stack for web development at Icalia Labs.
set -e
# Shared functions
pretty_print() {
printf "\n%b\n" "$1"
}
#
pretty_print "Here we go..."
# So it begins
# Oh my zsh installation
pretty_print "Installing oh-my-zsh..."
curl -L http://install.ohmyz.sh | sh
# zsh fix
if [[ -f /etc/zshenv ]]; then
pretty_print "Fixing OSX zsh environment bug ..."
sudo mv /etc/{zshenv,zshrc}
fi
# Homebrew installation
if ! command -v brew &>/dev/null; then
pretty_print "Installing Homebrew, an OSX package manager, follow the instructions..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
if ! grep -qs "recommended by brew doctor" ~/.zshrc; then
pretty_print "Put Homebrew location earlier in PATH ..."
printf '\n# recommended by brew doctor\n' >> ~/.zshrc
printf 'export PATH="/usr/local/bin:$PATH"\n' >> ~/.zshrc
export PATH="/usr/local/bin:$PATH"
fi
else
pretty_print "You already have Homebrew installed...good job!"
fi
# Homebrew OSX libraries
pretty_print "Updating brew formulas"
brew update
pretty_print "Installing GNU core utilities..."
brew install coreutils
pretty_print "Installing GNU find, locate, updatedb and xargs..."
brew install findutils
pretty_print "Installing the most recent verions of some OSX tools"
brew tap homebrew/dupes
brew install homebrew/dupes/grep
printf 'export PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"' >> ~/.zshrc
export PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
# Git installation
pretty_print "Installing git for control version"
brew install git
# Posgresql installation
pretty_print "Installing postgresql for database management"
brew install postgresql --no-python
# Vim installation
pretty_print "Installing vim with Homebrew for latest version"
brew install vim
# Image magick installation
pretty_print "Installing image magick for image processing"
brew install imagemagick
# Rbenv installation
pretty_print "Rbenv installation for managing your rubies"
brew install rbenv
if ! grep -qs "rbenv init" ~/.zshrc; then
printf 'export PATH="$HOME/.rbenv/bin:$PATH"\n' >> ~/.zshrc
printf 'eval "$(rbenv init - --no-rehash)"\n' >> ~/.zshrc
pretty_print "Enable shims and autocompletion ..."
eval "$(rbenv init -)"
fi
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
pretty_print "Installing rbenv-gem-rehash, we don't want to rehash everytime we add a gem..."
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
pretty_print "Installing ruby-build to install Rubies ..."
brew install ruby-build
# OpenSSL linking
pretty_print "Installing and linking OpenSSL..."
brew install openssl
brew link openssl --force
# Install ruby latest version
ruby_version="$(curl -sSL https://raw.githubusercontent.com/IcaliaLabs/kaishi/master/latest_ruby)"
pretty_print "Installing Ruby $ruby_version"
if [ "$ruby_version" = "2.1.1" ]; then
curl -fsSL https://gist.github.com/mislav/a18b9d7f0dc5b9efc162.txt | rbenv install --patch 2.1.1
else
rbenv install "$ruby_version"
fi
pretty_print "Set ruby version $ruby_version as the default"
rbenv global "$ruby_version"
rbenv rehash
pretty_print "Updating gems..."
gem update --system
pretty_print "Setup gemrc for default options"
if [ ! -f ~/.gemrc ]; then
printf 'gem: --no-document' >> ~/.gemrc
fi
# Bundler installation
pretty_print "Installing bundler..."
gem install bundler
#
pretty_print "Optimizing Bundler..."
number_of_cores=$(sysctl -n hw.ncpu)
bundle config --global jobs $((number_of_cores - 1))
pretty_print "Installing Foreman..."
gem install foreman
pretty_print "Installing Rails...finally!"
gem install rails
pretty_print "Installing mailcatcher gem...!"
gem install mailcatcher
pretty_print "Installing platter..."
gem install platter
pretty_print "Installing the heroku toolbelt..."
brew install heroku-toolbelt
pretty_print "Installing pow to serve local rails apps like a superhero..."
curl get.pow.cx | sh
pretty_print "Installing NodeJs..."
brew install node
pretty_print "Installing Grunt..."
npm install -g grunt-cli
#Install brew cask
pretty_print "Installing cask to install apps"
brew install caskroom/cask/brew-cask
pretty_print "Installing launchrocket to manage your homebrew formulas like a champ!"
brew cask install launchrocket
#Install apps
# List of apps we use at Icalia Labs
apps=(
slack
spotify
google-chrome
dropbox
appcleaner
firefox
mou
iterm2
macvim
sublime-text
gitx
testflight
vlc
google-drive
tomighty
rescuetime
)
for app in "${apps[@]}"
do
printf "Should I install %s\n" $app
echo "Type Y to accept: \c"
read line
if [ "$line" = Y ] || [ "$line" = y ]; then
brew cask install --appdir="/Applications" $app
fi
done
#Installing fonts
pretty_print "Installing some caskroom/fonts..."
brew tap caskroom/fonts
fonts=(
font-m-plus
font-clear-sans
font-roboto
font-open-sans
font-source-sans-pro
font-lobster
font-alegreya
font-montserrat
font-inconsolata
font-pt-sans
font-quattrocento-sans
font-quicksand
font-raleway
font-sorts-mill-goudy
font-ubuntu
)
# install fonts
pretty_print "Installing the fonts..."
brew cask install ${fonts[@]}
pretty_print "We are done!...everthing looks good!"