Skip to content

Commit

Permalink
try this for bootstrapping folks
Browse files Browse the repository at this point in the history
  • Loading branch information
atmos committed Oct 6, 2010
1 parent 694a2a9 commit da54e75
Showing 1 changed file with 26 additions and 30 deletions.
56 changes: 26 additions & 30 deletions bootstrap.sh
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. :("

0 comments on commit da54e75

Please sign in to comment.