pyenv/libexec/rbenv-version-file

23 lines
397 B
Text
Raw Normal View History

#!/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
2011-09-11 12:58:57 -04:00
GLOBAL_PATH="${RBENV_ROOT}/global"
DEFAULT_PATH="${RBENV_ROOT}/default"
2011-08-18 15:32:33 -04:00
if [ -e "$GLOBAL_PATH" ]; then
echo "$GLOBAL_PATH"
elif [ -e "$DEFAULT_PATH" ]; then
echo "$DEFAULT_PATH"
else
echo "$GLOBAL_PATH"
fi