-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·205 lines (176 loc) · 5.04 KB
/
install.sh
File metadata and controls
executable file
·205 lines (176 loc) · 5.04 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
#!/bin/sh
prompt_user_for_install(){
while true; do
#action is $1
#name is $2
read -p "Do you want to $1 $2 [y/n]?" yn
case $yn in
[Yy]* ) return 0;;
[Nn]* ) return 1;;
* ) echo "Please answer yes or no.";;
esac
done
}
backup_file(){
#file is $1
echo "\033[0;32mBacking up to ~/.$1.pre-quickconfig\033[0m";
cp ~/.$1 ~/.$1.pre-quickconfig;
rm ~/.$1;
}
install_file(){
echo "\033[0;34mInstalling ~/.$1\033[0m"
cp ./$1 ~/.$1;
}
check_and_install_config_file(){
#file is $1
echo "\033[0;34mLooking for an existing .$1...\033[0m"
if [ -f ~/.$1 ] || [ -h ~/.$1 ]
then
echo "\033[0;33mFound ~/.$1.\033[0m"
if prompt_user_for_install "backup and replace" "your ~/.$1"
then
backup_file $1
install_file $1
else
echo "\033[0;34mSkipping install of ~/.$1\033[0m";
fi
else
install_file $1
fi
}
######################
# HomeBrew #
######################
echo "";
echo "\033[0;32m>>>\033[0m 1. Installing HomeBrew"
if /usr/bin/which -s brew
then
echo "\033[0;33mYou already have HomeBrew installed.\033[0m"
else
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
fi
######################
# oh-my-zsh #
######################
echo "";
echo "\033[0;32m>>>\033[0m 2. Installing zsh"
if [ -d ~/.oh-my-zsh ]
then
echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m"
else
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
fi
check_and_install_config_file "zshrc"
if [ -f ~/.oh-my-zsh/themes/jmig.zsh-theme ] || [ -h ~/.oh-my-zsh/themes/jmig.zsh-theme ]
then
echo "\033[0;33mDeleting previous jmig zsh theme\033[0m";
rm ~/.oh-my-zsh/themes/jmig.zsh-theme;
fi
echo "\033[0;34mInstalling jmig.zsh-theme\033[0m"
cp ./jmig.zsh-theme ~/.oh-my-zsh/themes/jmig.zsh-theme
######################
# Git #
######################
echo "";
echo "\033[0;32m>>>\033[0m 3. Installing git & git config"
if /usr/bin/which -s git
then
echo "\033[0;33mYou already have Git installed.\033[0m"
else
brew install git
fi
check_and_install_config_file "gitconfig"
check_and_install_config_file "gitignore"
######################
# RVM #
######################
echo "";
echo "\033[0;32m>>>\033[0m 4. Installing rvm & Ruby"
if prompt_user_for_install "install rvm and latest ruby stable" ""
then
curl -sSL https://get.rvm.io | bash -s stable --ruby --auto-dotfiles
else
echo "\033[0;34mSkipping install of rvm/ruby\033[0m";
fi
######################
# Vim #
######################
echo "";
echo "\033[0;32m>>>\033[0m 5. Installing vim config"
check_and_install_config_file "vimrc"
######################
# Term Notifier #
######################
echo "";
echo "\033[0;32m>>>\033[0m 6. Installing terminal-notifier"
if /usr/bin/which -s terminal-notifier
then
echo "\033[0;33mYou already have terminal-notifier installed.\033[0m"
else
gem install terminal-notifier
fi
######################
# AppleDoc #
######################
echo "";
echo "\033[0;32m>>>\033[0m 7. Installing appledoc"
if /usr/bin/which -s appledoc
then
echo "\033[0;33mYou already have appledoc installed.\033[0m"
else
brew install appledoc
fi
######################
# XCode Theme #
######################
echo "";
echo "\033[0;32m>>>\033[0m 8. Installing XCode theme"
if [ -f ~/Library/Developer/Xcode/UserData/FontAndColorThemes/jmig.dvtcolortheme ] || [ -h ~/Library/Developer/Xcode/UserData/FontAndColorThemes/jmig.dvtcolortheme ]
then
echo "\033[0;33mDeleting previous jmig Xcode theme\033[0m";
rm ~/Library/Developer/Xcode/UserData/FontAndColorThemes/jmig.dvtcolortheme;
fi
echo "\033[0;34mInstalling jmig Xcode theme\033[0m"
if [ ! -d ~/Library/Developer/Xcode/UserData/FontAndColorThemes/ ]
then
mkdir -p ~/Library/Developer/Xcode/UserData/FontAndColorThemes/
fi
cp ./jmig.dvtcolortheme ~/Library/Developer/Xcode/UserData/FontAndColorThemes/jmig.dvtcolortheme
#This theme needs the font Inconsolata by Raph Levien
echo "\033[0;34mDownloading & Installing Inconsolata Font by Raph Levien\033[0m"
curl -SL "http://levien.com/type/myfonts/Inconsolata.otf" > Inconsolota.otf
mv Inconsolota.otf ~/Library/Fonts/Inconsolata.otf
######################
# xctool #
######################
echo "";
echo "\033[0;32m>>>\033[0m 9. Installing xctool"
if /usr/bin/which -s xctool
then
echo "\033[0;33mYou already have xctool installed.\033[0m"
else
brew install xctool
fi
######################
# chisel #
######################
echo "";
echo "\033[0;32m>>>\033[0m 10. Installing chisel"
if (brew list | grep -x chisel)
then
echo "\033[0;33mYou already have Chisel installed.\033[0m"
else
touch ~/.lldbinit
brew install chisel
CHISEL_CMD_LINE=`brew info chisel | tail -1 | sed -e 's/^ *//' -e 's/ *$//'`
if grep -Fxq "$CHISEL_CMD_LINE" ~/.lldbinit
then
echo "\033[0;33m.lldbinit already with Chisel installed.\033[0m"
else
echo $CHISEL_CMD_LINE >> ~/.lldbinit
fi
fi
echo "";
echo "";
echo "\033[0;32mInstallation OK!!!";
echo "Start a new session and enjoy\033[0m";