1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-10 20:43:48 -05:00
Files
pyenv/libexec/rbenv-version-file
2011-09-12 10:11:59 -05:00

24 lines
429 B
Bash
Executable File

#!/usr/bin/env bash
set -e
[ -n "$RBENV_DEBUG" ] && set -x
root="$(pwd)"
while [ -n "$root" ]; do
if [ -e "${root}/.rbenv-version" ]; then
echo "${root}/.rbenv-version"
exit
fi
root="${root%/*}"
done
GLOBAL_PATH="${RBENV_ROOT}/global"
DEFAULT_PATH="${RBENV_ROOT}/default"
if [ -e "$GLOBAL_PATH" ]; then
echo "$GLOBAL_PATH"
elif [ -e "$DEFAULT_PATH" ]; then
echo "$DEFAULT_PATH"
else
echo "$GLOBAL_PATH"
fi