From 0a4ffcd15f6d02f9c707af008d9c2542dc1f864d Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Wed, 28 Sep 2011 09:45:58 -0500 Subject: [PATCH] Global version file is now `${RBENV_ROOT}/version` This is the last time it'll change. Promise. --- .gitignore | 4 ++-- libexec/rbenv-global | 3 ++- libexec/rbenv-version-file | 15 ++++++++------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 5be802e6..c74d07f5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -/versions /shims -/global +/version +/versions diff --git a/libexec/rbenv-global b/libexec/rbenv-global index 0c239fd1..2f68f2ec 100755 --- a/libexec/rbenv-global +++ b/libexec/rbenv-global @@ -9,12 +9,13 @@ if [ "$1" = "--complete" ]; then fi RBENV_VERSION="$1" -RBENV_VERSION_FILE="${RBENV_ROOT}/global" +RBENV_VERSION_FILE="${RBENV_ROOT}/version" if [ -n "$RBENV_VERSION" ]; then rbenv-version-file-write "$RBENV_VERSION_FILE" "$RBENV_VERSION" else rbenv-version-file-read "$RBENV_VERSION_FILE" || + rbenv-version-file-read "${RBENV_ROOT}/global" || rbenv-version-file-read "${RBENV_ROOT}/default" || echo system fi diff --git a/libexec/rbenv-version-file b/libexec/rbenv-version-file index 31b8670d..9b678769 100755 --- a/libexec/rbenv-version-file +++ b/libexec/rbenv-version-file @@ -11,13 +11,14 @@ while [ -n "$root" ]; do root="${root%/*}" done -GLOBAL_PATH="${RBENV_ROOT}/global" -DEFAULT_PATH="${RBENV_ROOT}/default" +global_version_file="${RBENV_ROOT}/version" -if [ -e "$GLOBAL_PATH" ]; then - echo "$GLOBAL_PATH" -elif [ -e "$DEFAULT_PATH" ]; then - echo "$DEFAULT_PATH" +if [ -e "$global_version_file" ]; then + echo "$global_version_file" +elif [ -e "${RBENV_ROOT}/global" ]; then + echo "${RBENV_ROOT}/global" +elif [ -e "${RBENV_ROOT}/default" ]; then + echo "${RBENV_ROOT}/default" else - echo "$GLOBAL_PATH" + echo "$global_version_file" fi