forked from abtain/cinderella
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,39 @@ | ||
echo "Ensuring we have the latest version of cinderella installed" | ||
echo "Run started `date`" >> ~/.cinderella.bootstrap.log 2>&1 | ||
which ruby >> ~/.cinderella.bootstrap.log 2>&1 | ||
which gem >> ~/.cinderella.bootstrap.log 2>&1 | ||
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 | ||
|
||
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 | ||
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 uninstall cinderella -aIx >> ~/.cinderella/bootstrap.log 2>&1 | ||
sudo gem install cinderella --no-rdoc --no-ri >> ~/.cinderella/bootstrap.log 2>&1 | ||
fi | ||
|
||
echo "Cinderella installed successfully" | ||
|
||
hash -r | ||
cinderella | ||
if [ "$?" -eq "0" ]; then | ||
if [ -d ~/.cinderella ]; then | ||
mv ~/.cinderella.bootstrap.log ~/.cinderella | ||
fi | ||
source ~/.cinderella.profile | ||
function run_cinderella { | ||
hash -r | ||
else | ||
echo "Something went wonky, retrying" | ||
if [ -f ~/.cinderella.profile ]; then | ||
source ~/.cinderella.profile | ||
fi | ||
cinderella | ||
if [ "$?" -eq "0" ]; then | ||
source ~/.cinderella.profile | ||
hash -r | ||
else | ||
echo "Something went wonky again, retrying once more" | ||
cinderella | ||
if [ "$?" -eq "0" ]; then | ||
source ~/.cinderella.profile | ||
hash -r | ||
else | ||
cat ~/.cinderella.bootstrap.log | ||
echo "" | ||
echo "Something went wonky with the install. :(" | ||
fi | ||
exit 0 | ||
fi | ||
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. :(" |