2011-08-18 15:11:40 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
2011-09-12 11:11:59 -04:00
|
|
|
[ -n "$RBENV_DEBUG" ] && set -x
|
2011-08-18 15:11:40 -04:00
|
|
|
|
2011-09-27 16:50:39 -04:00
|
|
|
root="$RBENV_DIR"
|
2011-08-18 15:11:40 -04:00
|
|
|
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
|