Permalink
Browse files

Check for .bashrc and .bash_profile before attempting to insert rvm f…

…unction.
  • Loading branch information...
1 parent d1ab83f commit 5206441282650cadbf72e2adcc535da8aa495a73 @joshfng joshfng committed Mar 29, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 railsready.sh
View
@@ -132,8 +132,12 @@ elif [ $whichRuby -eq 2 ] ; then
[[ -f rvm-installer ]] && rm -f rvm-installer
echo -e "\n=> Setting up RVM to load with new shells..."
#if RVM is installed as user root it goes to /usr/local/rvm/ not ~/.rvm
- echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*' >> "$HOME/.bash_profile"
- echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*' >> "$HOME/.bashrc"
+ if [ -f ~/.bashrc ] ; then
+ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*' >> "$HOME/.bashrc"
+ fi
+ if [ -f ~/.bash_profile ] ; then
+ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*' >> "$HOME/.bash_profile"
+ fi
echo "==> done..."
echo "=> Loading RVM..."
if [ -f ~/.bashrc ] ; then

0 comments on commit 5206441

Please sign in to comment.