You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

22 lines
399 B

#!/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="${HOME}/.rbenv/global"
DEFAULT_PATH="${HOME}/.rbenv/default"
if [ -e "$GLOBAL_PATH" ]; then
echo "$GLOBAL_PATH"
elif [ -e "$DEFAULT_PATH" ]; then
echo "$DEFAULT_PATH"
else
echo "$GLOBAL_PATH"
fi