scripts/rvm-install in rvm-0.1.0 vs scripts/rvm-install in rvm-0.1.1

- old
+ new

@@ -16,23 +16,22 @@ --help : Display help/usage (this) message --version : display rvm package version " } +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 ;; --prefix) prefix_path="$1" ; shift ;; --version) rvm_path="$(pwd)" ; __rvm_version ; unset rvm_path ; exit ;; --help|*) usage ;; esac done -if [[ -s /etc/rvmrc ]] ; then source /etc/rvmrc ; fi -if [[ -s "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi - if ! [[ "$rvm_path" =~ /rvm/?$ ]] ; then unset rvm_path if [[ "root" = "$(whoami)" ]] ; then rvm_path="/usr/local/rvm" else @@ -54,36 +53,51 @@ if [[ ! -d "$source_path" ]] ; then unset source_path ; fi source_path="${source_path:-$cwd}" # State what is required to use rvm echo -e "\nInstalling rvm to $rvm_path/ ..." -for dir_name in src scripts bin log archives config gems examples ; do - mkdir -p "$rvm_path/$dir_name" +rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}" +rvm_src_path="${rvm_src_path:-"$rvm_path/src"}" +rvm_log_path="${rvm_log_path:-"$rvm_path/log"}" +rvm_bin_path="${rvm_bin_path:-"$rvm_path/bin"}" +rvm_gem_path="${rvm_gem_path:-"$rvm_path/gems"}" +rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}" +rvm_config_path="${rvm_config_path:-"$rvm_path/config"}" +rvm_hooks_path="${rvm_hooks_path:-"$rvm_path/hooks"}" +rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}" +rvm_symlink_path="${rvm_symlink_path:-/usr/local/bin}" +rvm_gem_options="${rvm_gem_options:-"--no-rdoc --no-ri"}" + +for path in src scripts bin log archives config gem ; do + eval "mkdir -p '\$rvm_${path}_path/'" done -cp -f "$source_path/README" "$rvm_path/" +for file in README LICENCE ; do + cp -f "$source_path/$file" "$rvm_path/" +done + # # Scripts # -rm -rf $rvm_scripts_path # Clear the old scripts directory so that the old style rvm- scripts are cleared out. for dir_name in config scripts examples lib hooks ; do mkdir -p "$rvm_path/$dir_name" if [[ -d "$source_path/$dir_name" ]] ; then cp -Rf "$source_path/$dir_name" "$rvm_path" fi done ; unset dir_name if [[ ! -s "$rvm_config_path/user" ]] ; then + mkdir -p "$rvm_config_path/" echo '# Users settings file, overrides db file settings and persists across installs.' >> $rvm_config_path/user fi # # Bin Scripts # # Cleanse and purge... -rm -f $rvm_bin_path/rvm ; rm -rf $rvm_bin_path/binscripts for file in rvm-prompt rvm rvmsudo ; do + rm -f "$rvm_bin_path/$file" cp -f "$source_path/binscripts/$file" $rvm_bin_path/ done chmod +x $rvm_bin_path/* # @@ -152,12 +166,15 @@ echo -e "My irc nickname is 'wayneeseguin' and I hang out from ~09:00-17:00EST and again from ~21:00EST-~00:00EST." echo -e "If I do not respond right away, please hang around after asking your question, I will respond as soon as I am back." echo -e "\n w$(tput setaf 2)⦿‿⦿$(tput sgr0)t!" echo -e "\n ~ Wayne" echo -e "\n********************************************************************************" -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 "\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 "\n3) $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n" + +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 "\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 "\n3) $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n" +fi exit 0