scripts/rvm-install in rvm-0.0.9999 vs scripts/rvm-install in rvm-0.1.0
- old
+ new
@@ -62,31 +62,31 @@
cp -f "$source_path/README" "$rvm_path/"
#
# Scripts
#
-rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
+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_path/config/user" ]] ; then
- echo '# Users settings file, overrides db file settings and persists across installs.' >> $rvm_path/config/user
+if [[ ! -s "$rvm_config_path/user" ]] ; then
+ 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_path/bin/rvm ; rm -rf $rvm_path/bin/binscripts
+rm -f $rvm_bin_path/rvm ; rm -rf $rvm_bin_path/binscripts
for file in rvm-prompt rvm rvmsudo ; do
- cp -f "$source_path/binscripts/$file" $rvm_path/bin/
+ cp -f "$source_path/binscripts/$file" $rvm_bin_path/
done
-chmod +x $rvm_path/bin/*
+chmod +x $rvm_bin_path/*
#
# RC Files
#
if [[ ! -z "$rvm_auto_flag" ]] ; then
@@ -99,54 +99,62 @@
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:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
+ echo " Adding 'if [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi' to $rcfile."
+ echo -e "\n# rvm-install added:\nif [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi\n" >> $rcfile
fi
done
fi
fi
#
-# TODO: Migrate ~/.rvm/ruby-X,jruby-X,... to ~/.rvm/rubies/
+# Migrate ~/.rvm/ruby-X,jruby-X,... to ~/.rvm/rubies/ for 0.1.0.
#
-#rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
-#mkdir -p $rvm_rubies_path
-#for ruby in "$rvm_path"/ruby-* "$rvm_path"/jruby-* "$rvm_path"/mput-* "$rvm_path"/rbx-* ; do
-# if [[ -d "$ruby" ]] ; then mv "$ruby" "$rvm_rubies_path" ; fi
-#done
+rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
+mkdir -p "$rvm_rubies_path/"
+for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
+ if [[ -d "$ruby" ]] ; then
+ mv "$ruby" "$rvm_rubies_path/"
+ new_path="$rvm_rubies_path/$(basename $ruby)"
+ for file in gem rake ; do
+ if [[ -s "$new_path/bin/$file" ]] ; then
+ sed -i -e '1,1s=.*=#!'"$new_path/bin/ruby=" "$new_path/bin/$file"
+ rm -f "$new_path/bin/$file.orig"
+ chmod +x "$new_path/bin/$file"
+ fi
+ done
+ fi
+done
+#
+# End of migration.
+#
if [[ "root" = "$(whoami)" ]] ; then
echo -e "\n Symlinking rvm to $rvm_symlink_path/rvm ..."
mkdir -p $rvm_symlink_path
- ln -nfs $rvm_path/bin/rvm $rvm_symlink_path/rvm
- ln -nfs $rvm_path/bin/rvmsudo $rvm_symlink_path/rvmsudo
+ ln -nfs $rvm_bin_path/rvm $rvm_symlink_path/rvm
+ ln -nfs $rvm_bin_path/rvmsudo $rvm_symlink_path/rvmsudo
chmod +x $rvm_symlink_path/rvm
chmod +x $rvm_symlink_path/rvmsudo
fi
echo -e "\n$(tput setaf 2)rvm$(tput sgr0) - shell scripts that allows a user to manage multiple ruby versions in their own account."
-$rvm_path/scripts/notes
+$rvm_scripts_path/notes
echo -e "$(tput setaf 2)RTFM: $(tput sgr0) http://rvm.beginrescueend.com/"
echo -e "\n$(tput setaf 2)HELP: $(tput sgr0) http://webchat.freenode.net/?channels=rvm "
-echo "================================================================================"
+echo -e "\n********************************************************************************"
name="$(awk -F= '/^[[:space:]]*name/{print $2}' ~/.gitconfig 2>/dev/null)"
echo -e "\n${name:-"$(whoami)"},\n"
echo -e "\nThank you for using rvm. I hope that it makes your work easier and more enjoyable."
echo -e "If you have any questions, issues and/or ideas for improvement please hop in #rvm on irc.freenode.net and let me know."
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\n"
-echo "================================================================================"
-echo -e "Upgrades"
-echo -e "Gems are now per interpreter installation instead of per interpreter/version"
-echo -e "so for example to upgrade an older install of 1.8.6 and preserve gems:"
-echo -e "rm -rf ~/.rvm/gems/ruby-1.8.6-p383 ; mv ~/.rvm/gems/ruby/1.8.6 ~/.rvm/gems/ruby-1.8.6-p383"
-echo "================================================================================"
+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"