scripts/rvm-install in rvm-0.1.47 vs scripts/rvm-install in rvm-1.0.0

- old
+ new

@@ -45,11 +45,11 @@ printf "\r${array[$index]}" let "spinner_counter=spinner_counter+1" command -v perl > /dev/null 2>&1 && perl -e 'sleep 0.5' } -if echo "$*" | grep -q 'trace' ; then echo "$*" ; env | grep '^rvm_' ; set -x ; fi +if echo "$*" | \grep -q 'trace' ; then echo "$*" ; env | \grep '^rvm_' ; set -x ; fi while [[ $# -gt 0 ]] ; do token="$1" ; shift case "$token" in --auto) rvm_auto_flag=1 ;; @@ -70,11 +70,11 @@ if [[ -z "$rvm_path" ]] ; then rvm_path="${rvm_prefix}rvm" ; fi source scripts/initialize -if grep -q 'scripts/rvm' $HOME/.bash* 2>/dev/null || grep -q 'scripts/rvm' $HOME/.zsh* 2>/dev/null; then +if \grep -q 'scripts/rvm' $HOME/.bash* 2>/dev/null || \grep -q 'scripts/rvm' $HOME/.zsh* 2>/dev/null; then if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then export upgrade_flag=1 else export upgrade_flag=0 fi @@ -176,16 +176,16 @@ printf "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 if [[ -s "$HOME/.profile" ]] ; then - if ! grep -q '.profile' "$rcfile" ; then + if ! \grep -q '.profile' "$rcfile" ; then echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile." printf "\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 + if ! \grep -q "scripts\/rvm" "$rcfile" ; then echo " Adding 'if [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi' to $rcfile." printf "\n# rvm-install added:\nif [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi\n" >> $rcfile fi done fi @@ -273,11 +273,11 @@ fi done # Move from legacy defaults to the new, alias based system. if [[ -s "$rvm_config_path/default" ]]; then - original_version="$(basename "$(grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")" + original_version="$(basename "$(\grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")" if [[ -n "$original_version" ]]; then $rvm_scripts_path/alias create default "$original_version" &> /dev/null fi unset original_version \rm -rf "$rvm_config_path/default" @@ -333,10 +333,10 @@ printf "\n Be absolutely *sure* to REMOVE the '&& return'." printf "\n If you wish to DRY up your config you can 'source ~/.bashrc' at the bottom of your .bash_profile." printf "\n placing all non-interactive items in the .bashrc, including the 'source' line above" printf "\n3) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n" fi - if [[ -s "$HOME/.bashrc" ]] && grep -q '&& return' "$HOME/.bashrc" ; then + if [[ -s "$HOME/.bashrc" ]] && \grep -q '&& return' "$HOME/.bashrc" ; then printf "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc." printf "\n This means that if you see '[ -z \"\$PS1\" ] && return' then you must change this line to:" printf "\n if [[ -n \"\$PS1\" ]] ; then" printf "\n ... original content that was below the && return line ..." printf "\n fi # <= be sure to close the if."