mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
4fde4ecbaf
It's only supposed to be set from `version-origin` hooks, but not inherited from environment in case it was set.
21 lines
458 B
Bash
Executable file
21 lines
458 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Summary: Explain how the current Ruby version is set
|
|
set -e
|
|
[ -n "$RBENV_DEBUG" ] && set -x
|
|
|
|
unset RBENV_VERSION_ORIGIN
|
|
|
|
OLDIFS="$IFS"
|
|
IFS=$'\n' scripts=(`rbenv-hooks version-origin`)
|
|
IFS="$OLDIFS"
|
|
for script in "${scripts[@]}"; do
|
|
source "$script"
|
|
done
|
|
|
|
if [ -n "$RBENV_VERSION_ORIGIN" ]; then
|
|
echo "$RBENV_VERSION_ORIGIN"
|
|
elif [ -n "$RBENV_VERSION" ]; then
|
|
echo "RBENV_VERSION environment variable"
|
|
else
|
|
rbenv-version-file
|
|
fi
|