Skip to content

Commit

Permalink
Tweaked version difference message a bit, great stuff thanks docwhat :)
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed Oct 31, 2009
1 parent 67e6eb0 commit 1c381d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 4 additions & 5 deletions scripts/cli
Expand Up @@ -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}]" ; }
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions scripts/rvm
Expand Up @@ -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\""

Expand Down

0 comments on commit 1c381d7

Please sign in to comment.