Permalink
Browse files

Tweaked version difference message a bit, great stuff thanks docwhat :)

  • Loading branch information...
1 parent 67e6eb0 commit 1c381d7ff1c8907bd62861873efabae2da88f63f @wayneeseguin wayneeseguin committed Oct 31, 2009
Showing with 5 additions and 7 deletions.
  1. +4 −5 scripts/cli
  2. +1 −2 scripts/rvm
View
@@ -4,7 +4,7 @@ function __rvm_meta {
rvm_meta_author="Wayne E. Seguin"
rvm_meta_author_email="wayneeseguin@gmail.com"
rvm_meta_website="http://rvm.beginrescueend.com/"
- rvm_meta_version="${RVM_VERSION}"
+ rvm_meta_version="${rvm_version}"
}
function __rvm_version { __rvm_meta ; echo "rvm ${rvm_meta_version} by ${rvm_meta_author} (${rvm_meta_author_email}) [${rvm_meta_website}]" ; }
@@ -353,10 +353,9 @@ function rvm {
# Check that this is the current version.
disk_version=$(cat "${rvm_path:-$HOME/.rvm}/lib/VERSION.yml" | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//')
- if [ -z "${RVM_VERSION}" -o "${RVM_VERSION}" != "${disk_version}" ]; then
- echo "Your shell's copy of rvm is out of date with the version on disk."
- echo "Please restart your shell or run rvm-restart."
- return 1
+ if [[ "${rvm_version}" != "${disk_version}" ]] && [[ "reload" != "$1" ]]; then
+ echo -e "A newer version of rvm has been installed ($disk_version) than is loaded ($rvm_version), please do one of the following:\n * 'rvm reload'\n * open a new shell\n * source your shell init scripts"
+ return 1
fi
__rvm_cleanup_variables
View
@@ -17,8 +17,7 @@ source $rvm_path/scripts/cli
source $rvm_path/scripts/gems
rvm_loaded_flag=1 ; export rvm_loaded_flag
-RVM_VERSION=$(cat "${rvm_path}/lib/VERSION.yml" | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//')
-export RVM_VERSION
+rvm_version="$(cat "${rvm_path}/lib/VERSION.yml" | tail -n 3 | sed 's/^.*: //g' | tr "\n" '.' | sed 's/\.$//')" ; export rvm_version
alias rvm-restart="source \"${rvm_path}/scripts/rvm\""

0 comments on commit 1c381d7

Please sign in to comment.