2011-08-12 05:33:45 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
2011-08-09 16:41:35 -04:00
|
|
|
|
|
|
|
if [ -z "$RBENV_VERSION" ]; then
|
2011-08-18 15:11:40 -04:00
|
|
|
RBENV_VERSION_FILE="$(rbenv-version-file)"
|
|
|
|
RBENV_VERSION="$(rbenv-version-file-read "$RBENV_VERSION_FILE" || true)"
|
2011-08-09 16:41:35 -04:00
|
|
|
fi
|
|
|
|
|
2011-09-09 16:52:31 -04:00
|
|
|
if [ -z "$RBENV_VERSION" ] || [ "$RBENV_VERSION" = "system" ]; then
|
|
|
|
echo "system"
|
2011-08-09 16:41:35 -04:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2011-08-25 03:24:44 -04:00
|
|
|
RBENV_VERSION_PATH="${RBENV_HOME}/versions/${RBENV_VERSION}"
|
2011-08-09 16:41:35 -04:00
|
|
|
|
|
|
|
if [ -d "$RBENV_VERSION_PATH" ]; then
|
|
|
|
echo "$RBENV_VERSION"
|
|
|
|
else
|
|
|
|
echo "rbenv: version \`$RBENV_VERSION' is not installed" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|