pyenv/libexec/rbenv-version-file
Alexander Rinass 5130f0464a Support install locations other than $HOME/.rbenv.
Define RBENV_HOME env variable in libexec/rbenv and let all script delegates use this variable to determine rbenv's install location.
2011-08-25 09:28:01 +02:00

22 lines
397 B
Bash
Executable file

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