mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Global version file is now ${RBENV_ROOT}/version
This is the last time it'll change. Promise.
This commit is contained in:
parent
65bf6279fa
commit
0a4ffcd15f
3 changed files with 12 additions and 10 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,3 +1,3 @@
|
||||||
/versions
|
|
||||||
/shims
|
/shims
|
||||||
/global
|
/version
|
||||||
|
/versions
|
||||||
|
|
|
@ -9,12 +9,13 @@ if [ "$1" = "--complete" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RBENV_VERSION="$1"
|
RBENV_VERSION="$1"
|
||||||
RBENV_VERSION_FILE="${RBENV_ROOT}/global"
|
RBENV_VERSION_FILE="${RBENV_ROOT}/version"
|
||||||
|
|
||||||
if [ -n "$RBENV_VERSION" ]; then
|
if [ -n "$RBENV_VERSION" ]; then
|
||||||
rbenv-version-file-write "$RBENV_VERSION_FILE" "$RBENV_VERSION"
|
rbenv-version-file-write "$RBENV_VERSION_FILE" "$RBENV_VERSION"
|
||||||
else
|
else
|
||||||
rbenv-version-file-read "$RBENV_VERSION_FILE" ||
|
rbenv-version-file-read "$RBENV_VERSION_FILE" ||
|
||||||
|
rbenv-version-file-read "${RBENV_ROOT}/global" ||
|
||||||
rbenv-version-file-read "${RBENV_ROOT}/default" ||
|
rbenv-version-file-read "${RBENV_ROOT}/default" ||
|
||||||
echo system
|
echo system
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -11,13 +11,14 @@ while [ -n "$root" ]; do
|
||||||
root="${root%/*}"
|
root="${root%/*}"
|
||||||
done
|
done
|
||||||
|
|
||||||
GLOBAL_PATH="${RBENV_ROOT}/global"
|
global_version_file="${RBENV_ROOT}/version"
|
||||||
DEFAULT_PATH="${RBENV_ROOT}/default"
|
|
||||||
|
|
||||||
if [ -e "$GLOBAL_PATH" ]; then
|
if [ -e "$global_version_file" ]; then
|
||||||
echo "$GLOBAL_PATH"
|
echo "$global_version_file"
|
||||||
elif [ -e "$DEFAULT_PATH" ]; then
|
elif [ -e "${RBENV_ROOT}/global" ]; then
|
||||||
echo "$DEFAULT_PATH"
|
echo "${RBENV_ROOT}/global"
|
||||||
|
elif [ -e "${RBENV_ROOT}/default" ]; then
|
||||||
|
echo "${RBENV_ROOT}/default"
|
||||||
else
|
else
|
||||||
echo "$GLOBAL_PATH"
|
echo "$global_version_file"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue