Permalink
Browse files

Update source line only if .profile exists

  • Loading branch information...
1 parent 9fa664e commit 4889b048fee05a07f51da239766cc3e7ca5e3826 @joshfng committed Mar 2, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 railsready.sh
View
@@ -132,11 +132,15 @@ elif [ $whichRuby -eq 2 ] ; then
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
if [ -f ~/.bashrc ] ; then
- echo 'source ~/.profile' >> "$HOME/.bashrc"
+ if [ -f ~/.profile ] ; then
+ echo 'source ~/.profile' >> "$HOME/.bashrc"
+ fi
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 'source ~/.profile' >> "$HOME/.bash_profile"
+ if [ -f ~/.profile ] ; then
+ echo 'source ~/.profile' >> "$HOME/.bash_profile"
+ fi
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..."

0 comments on commit 4889b04

Please sign in to comment.