mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
5130f0464a
Define RBENV_HOME env variable in libexec/rbenv and let all script delegates use this variable to determine rbenv's install location.
21 lines
465 B
Bash
Executable file
21 lines
465 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
if [ -z "$RBENV_VERSION" ]; then
|
|
RBENV_VERSION_FILE="$(rbenv-version-file)"
|
|
RBENV_VERSION="$(rbenv-version-file-read "$RBENV_VERSION_FILE" || true)"
|
|
fi
|
|
|
|
if [ "$RBENV_VERSION" = "system" ]; then
|
|
echo "$RBENV_VERSION"
|
|
exit
|
|
fi
|
|
|
|
RBENV_VERSION_PATH="${RBENV_HOME}/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
|