forked from abtain/cinderella
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·46 lines (39 loc) · 1.39 KB
/
bootstrap.sh
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
echo "Ensuring we have the latest version of cinderella installed"
echo "A first time install takes about 45 minutes on a modern machine"
mkdir -p ~/.cinderella
echo "Run started `date`" >> ~/.cinderella/bootstrap.log 2>&1
which ruby >> ~/.cinderella/bootstrap.log 2>&1
which gem >> ~/.cinderella/bootstrap.log 2>&1
if [ `gem --version` != "1.7.2" ]; then
echo "You need to upgrade rubygems to 1.7.2"
fi
which gem | grep -q rvm
if [ $? -eq 0 ]; then
gem uninstall cinderella -aIx >> ~/.cinderella/bootstrap.log 2>&1
gem install cinderella --no-rdoc --no-ri >> ~/.cinderella/bootstrap.log 2>&1
else
sudo gem uninstall cinderella -aIx >> ~/.cinderella/bootstrap.log 2>&1
sudo gem install cinderella --no-rdoc --no-ri >> ~/.cinderella/bootstrap.log 2>&1
sudo gem update >> ~/.cinderella/bootstrap.log 2>&1
fi
echo "Cinderella installed successfully"
function run_cinderella {
hash -r
if [ -f ~/.cinderella.profile ]; then
source ~/.cinderella.profile
fi
cinderella
if [ "$?" -eq "0" ]; then
exit 0
fi
}
# try cinderella three times just in case shit gets weird
run_cinderella
run_cinderella
run_cinderella
cat ~/.cinderella/bootstrap.log
echo ""
echo "Something went wrong with the install. :("
echo "Dump this log into a gist and link to me to it"
echo "http://github.com/atmos/cinderella/issues"
echo "Sorry it failed. :("