diff --git a/bootstrap.sh b/bootstrap.sh old mode 100644 new mode 100755 index ce314d7..689bb5b --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,11 +1,28 @@ +echo "Ensuring we have the latest version of cider installed" +echo "Run started `date`" >> ~/.cider.bootstrap.log 2>&1 +which ruby >> ~/.cider.bootstrap.log 2>&1 +which gem >> ~/.cider.bootstrap.log 2>&1 + which gem | grep -q rvm if [ $? -eq 0 ]; then - gem uninstall cider - gem install cider --no-rdoc --no-ri + gem uninstall cider -aIx >> ~/.cider.bootstrap.log 2>&1 + gem install cider --no-rdoc --no-ri >> ~/.cider.bootstrap.log 2>&1 else - sudo gem uninstall cider - sudo gem install cider --no-rdoc --no-ri + sudo gem uninstall cider -aIx >> ~/.cider.bootstrap.log 2>&1 + sudo gem install cider --no-rdoc --no-ri >> ~/.cider.bootstrap.log 2>&1 fi + +echo "Cider installed successfully" + hash -r cider -source ~/.cider.profile +if [ "$?" -eq "0" ]; then + if [ -d ~/.cider ]; then + mv ~/.cider.bootstrap.log ~/.cider + fi + source ~/.cider.profile +else + cat ~/.cider.bootstrap.log + echo "" + echo "Something went wonky with the install. :(" +fi