install in rvm-0.1.27 vs install in rvm-0.1.29

- old
+ new

@@ -27,11 +27,11 @@ spinner() { array=('/' '-' '\\' '|' '/' '-' '\\' '|') index=$((($spinner_counter % 8))) echo -e -n "\r${array[$index]}" let "spinner_counter=spinner_counter+1" - which perl > /dev/null 2>&1 && perl -e 'sleep 0.5' + 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 while [[ $# -gt 0 ]] ; do @@ -54,10 +54,11 @@ fi if [[ -z "$rvm_path" ]] ; then rvm_path="${rvm_prefix}rvm" ; fi source scripts/initialize + if grep -q 'scripts/rvm' $HOME/.bash* || grep -q 'scripts/rvm' $HOME/.zsh*; then if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then export upgrade_flag=1 else export upgrade_flag=0 @@ -100,21 +101,21 @@ echo -e -n " Installing rvm to $rvm_path/" fi spinner -mkdir -p $rvm_archives_path $rvm_src_path $rvm_log_path $rvm_bin_path $rvm_gems_path $rvm_rubies_path $rvm_config_path $rvm_hooks_path $rvm_tmp_path $rvm_symlink_path $HOME/.gem/cache +mkdir -p $rvm_archives_path $rvm_src_path $rvm_log_path $rvm_bin_path $rvm_gems_path $rvm_rubies_path $rvm_config_path $rvm_hooks_path $rvm_tmp_path for file in README LICENCE ; do spinner cp -f "$source_path/$file" "$rvm_path/" done # # Scripts # -for dir_name in config scripts examples lib hooks ; do +for dir_name in config scripts examples lib hooks help ; do spinner mkdir -p "$rvm_path/$dir_name" if [[ -d "$source_path/$dir_name" ]] ; then cp -Rf "$source_path/$dir_name" "$rvm_path" fi @@ -263,20 +264,31 @@ echo -e "*************************************************************************************************$(tput sgr0)\n" echo -e "Upgrade of RVM in $rvm_path/ is complete.\n" else if [[ "root" != "$(whoami)" ]] ; then echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)" - echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bashrc and then .bash_profile for bash and .zshrc for zsh), after all path/variable settings:" + echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bashrc or .bash_profile for bash and .zshrc for zsh), after all path/variable settings:" echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi" echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)." - echo -e "\n This means that if you see '[ -z "$PS1" ] && return' then you must remove it and split your .bashrc" - echo -e "\n Put everything *except the return code line(s)* into your .bash_profile, and everything above that code in your .bashrc." - echo -e "\n Be *sure* to REMOVE the '&& return' statement line." + echo -e "\n This means that if you see '[ -z "$PS1" ] && return' then you must change this line to:" + echo -e "\n if [[ ! -z "$PS1" ]] ; then" + echo -e "\n ... original content that was below the && return line ..." + echo -e "\n fi # <= be sure to close the if." + echo -e "\n #EOF .bashrc" + echo -e "\n Be absolutely *sure* to REMOVE the '&& return'." echo -e "\n If you wish to DRY up your config you can 'source ~/.bashrc' at the top of your .bash_profile." - echo -e "\n4) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n" + echo -e "\n placing all non-interactive items in the .bashrc" + echo -e "\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 '&& return' $HOME/.bashrc ; then - echo -e "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc. Please remove it and refactor your profiles to be correct. If you have questions about this please visit #rvm on irc.freenode.net.\n" + echo -e "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc. + This means that if you see '[ -z "$PS1" ] && return' then you must change this line to: + if [[ ! -z "$PS1" ]] ; then + ... original content that was below the && return line ... + fi # <= be sure to close the if. + #EOF .bashrc + + If you have any questions about this please visit #rvm on irc.freenode.net.\n" fi echo -e "Installation of RVM to $rvm_path/ is complete.\n\n" fi exit 0