scripts/rvm-install in rvm-0.0.48 vs scripts/rvm-install in rvm-0.0.49
- old
+ new
@@ -31,66 +31,67 @@
chmod +x $rvm_dir/bin/$file_name
done ; unset file_name
results=$(grep 'scripts/rvm' ~/.bash_profile ~/.bashrc ~/.zshrc > /dev/null)
if [ $? -gt 0 ] ; 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
-
+ if [ ! -z "`echo $PS1`" ] ; 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)? "
+ 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}" = "a" ] ; then
- user_shell="bash"
+ if [ "${response:0:1}" = "s" ] ; then
+ echo 'w00t!'
break
- elif [ "${response:0:1}" = "z" ] ; then
- user_shell="zsh"
+ elif [ "${response:0:1}" = "m" ] ; then
+ echo -e " Please make sure that this line is in place."
break
- elif [ "${response:0:1}" = "o" ] ; then
- user_shell="both"
- break
fi
done
- if [ "$user_shell" = "bash" -o "$user_shell" = "both" ] ; then
+ if [ "${response:0:1}" = "s" ] ; 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
+ 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
+ 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
- if [ "$user_shell" = "zsh" -o "$user_shell" = "both" ] ; then
+ fi
- 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
+ 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
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
@@ -130,33 +131,33 @@
rvm_emerge_binary=`which emerge 2> /dev/null`
rvm_pacman_binary=`which pacman 2> /dev/null`
rvm_yum_binary=`which yum 2> /dev/null`
if [ ! -z "$rvm_apt_get_binary" ] ; then
- echo -e " $item For jRuby (if you wish to use it) you will need:"
- echo -e " $ sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk"
- echo -e " $item For ree (if you wish to use it) you will need:"
- echo -e " $ sudo apt-get install libreadline5-dev libssl-dev bison"
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
+ echo -e " $ sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk"
+ echo -e " $item For ree (if you wish to use it) you will need:"
+ echo -e " $ sudo apt-get install libreadline5-dev libssl-dev bison"
elif [ ! -z "$rvm_emerge_binary" ] ; then
- echo -e " $item For jRuby (if you wish to use it) you will need:"
- echo -e " $ sudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
+ echo -e " $ sudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
elif [ ! -z "$rvm_pacman_binary" ] ; then
- echo -e " $item For jRuby (if you wish to use it) you will need:"
- echo -e " $ sudo pacman -Sy jdk jre"
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
+ echo -e " $ sudo pacman -Sy jdk jre"
elif [ ! -z "$rvm_yum_binary" ] ; then
- echo -e " $item For ree (if you wish to use it) you will need:"
- echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
+ echo -e " $item For ree (if you wish to use it) you will need:"
+ echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
else
- echo -e " $item For jRuby (if you wish to use it) you will need:"
- echo -e " The SUN java runtime environment and development kit."
+ echo -e " $item For jRuby (if you wish to use it) you will need:"
+ echo -e " The SUN java runtime environment and development kit."
fi
elif [ "$system" = "Darwin" ] ; then
- echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
- echo -e " $item If you intend on installing MacRuby you must install LLVM first."
+ echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
+ echo -e " $item If you intend on installing MacRuby you must install LLVM first."
fi
echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
echo -e " $item if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi"
echo -e " $item CLOSE THIS SHELL AND OPEN A NEW ONE in order to use rvm."