scripts/rvm-install in rvm-0.0.96 vs scripts/rvm-install in rvm-0.0.97

- old
+ new

@@ -64,14 +64,18 @@ # echo -e "\n Checking rc files ($rvm_rc_files) ..." if [[ "$rvm_loaded_flag" != "1" ]] ; then for rcfile in $(echo $rvm_rc_files) ; do if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi - - grep "scripts\/rvm" "$rcfile" > /dev/null 2>&1 - if [[ $? -gt 0 ]] ; then + if [[ -s "$HOME/.profile" ]] ; then + if ! grep -q '.profile' "$rcfile" ; then + echo " Adding 'if [[ -s $HOME/.profile ]] ; then source $HOME ; fi' to $rcfile." + echo -e "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile + fi + fi + if ! grep -q "scripts\/rvm" "$rcfile" ; then echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile." - echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile + echo -e "\n# rvm-install added:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile fi done fi if [[ "root" = "$(whoami)" ]] ; then