mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-14 20:39:55 -05:00
23 lines
557 B
Bash
Executable file
23 lines
557 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Summary: Show the current Ruby version
|
|
set -e
|
|
[ -n "$RBENV_DEBUG" ] && set -x
|
|
|
|
if [ -z "$RBENV_VERSION" ]; then
|
|
RBENV_VERSION_FILE="$(rbenv-version-file)"
|
|
RBENV_VERSION="$(rbenv-version-file-read "$RBENV_VERSION_FILE" || true)"
|
|
fi
|
|
|
|
if [ -z "$RBENV_VERSION" ] || [ "$RBENV_VERSION" = "system" ]; then
|
|
echo "system"
|
|
exit
|
|
fi
|
|
|
|
RBENV_VERSION_PATH="${RBENV_ROOT}/versions/${RBENV_VERSION}"
|
|
|
|
if [ -d "$RBENV_VERSION_PATH" ]; then
|
|
echo "$RBENV_VERSION"
|
|
else
|
|
echo "rbenv: version \`$RBENV_VERSION' is not installed" >&2
|
|
exit 1
|
|
fi
|