install in rvm-0.0.52 vs install in rvm-0.0.53
- old
+ new
@@ -29,69 +29,17 @@
for file_name in rvm-prompt gemsync ; do
mv $rvm_path/scripts/$file_name $rvm_path/bin/
chmod +x $rvm_path/bin/$file_name
done ; unset file_name
-results=$(grep 'scripts/rvm' ~/.bash_profile ~/.bashrc ~/.zshrc > /dev/null)
-if [ $? -gt 0 ] ; then
- if [ ! -z "`echo $PS1`" ] ; then
- while : ; do
- echo -n -e "$question Do you want this (s)cript to set this up for you, or do it (m)anually yourself ('s' or 'm')? "
- read response
- if [ "${response:0:1}" = "s" ] ; then
- echo 'w00t!'
- break
- elif [ "${response:0:1}" = "m" ] ; then
- echo -e " Please make sure that this line is in place."
- break
- fi
- done
-
- if [ "${response:0:1}" = "s" ] ; then
-
- while : ; do
- echo -n -e "$question Do you use b(a)sh or (z)sh or b(o)th for your shell (the default on most *nix systems is bash, press control + C to cancel the installation)\n(a/z/o)? "
- read response
- if [ "${response:0:1}" = "a" ] ; then
- user_shell="bash"
- break
- elif [ "${response:0:1}" = "z" ] ; then
- user_shell="zsh"
- break
- elif [ "${response:0:1}" = "o" ] ; then
- user_shell="both"
- break
- fi
- done
+if [ -z "$rvm_loaded_flag" ] ; then
+ for rcfile in .bash_profile .bashrc .zshrc ; do
+ if [ ! -e ~/$rcfile ] ; then touch ~/$rcfile ; fi
+ if [ -z "$(awk '/\.rvm\/scripts\/rvm/' ~/$rcfile)" ] ; then
+ echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/$rcfile."
+ echo -e "\n# rvm installer added line:\nif [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi\n" >> ~/$rcfile
fi
- else
- user_shell="both"
- fi
-
- if [ "$user_shell" = "bash" -o "$user_shell" = "both" ] ; then
- touch ~/.bash_profile
- if [ -z "`grep '\.rvm/scripts/rvm' ~/.bash_profile`" ] ; then
- echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.bash_profile."
- echo -e "\n" >> ~/.bash_profile
- echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.bash_profile
- fi
- touch ~/.bashrc
- if [ -z "`grep '\.rvm/scripts/rvm' ~/.bashrc`" ] ; then
- echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.bashrc."
- echo -e "\n" >> ~/.bashrc
- echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.bashrc
- fi
-
- fi
-
- if [ "$user_shell" = "zsh" -o "$user_shell" = "both" ] ; then
- touch ~/.zshrc
- if [ -z "`grep '\.rvm/scripts/rvm' ~/.zshrc`" ] ; then
- echo "Adding 'if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi' to your ~/.zshrc."
- echo -e "\n" >> ~/.zshrc
- echo "if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi" >> ~/.zshrc
- fi
- fi
+ done
fi
echo -e "\n Ensuring that rvm script location in $file is scripts/rvm not bin/rvm for: ~/.bash_profile, ~/.bashrc, ~/.zshrc..."
for file in ~/.bash_profile ~/.bashrc ~/.zshrc ; do
if [ -s $file ] ; then