Add support for RBENV_PLUGIN_PATH environment variable

This commit is contained in:
Sam Stephenson 2011-09-21 13:00:23 -05:00
parent 0c7c62dc04
commit 096743acde
2 changed files with 8 additions and 5 deletions

View file

@ -27,6 +27,9 @@ else
fi
export RBENV_ROOT
export RBENV_PLUGIN_PATH="${RBENV_PLUGIN_PATH}:/etc/rbenv.d:${RBENV_ROOT}/rbenv.d"
libexec_path="$(abs_dirname "$0")"
export PATH="${libexec_path}:${PATH}"

View file

@ -17,9 +17,9 @@ if [ -z "$RBENV_COMMAND" ]; then
fi
shopt -s nullglob
SCRIPTS=(/etc/rbenv.d/"$RBENV_COMMAND"/*.bash ${RBENV_ROOT}/rbenv.d/"$RBENV_COMMAND"/*.bash)
shopt -u nullglob
for script in ${SCRIPTS[@]}; do
echo $script
for path in ${RBENV_PLUGIN_PATH//:/$'\n'}; do
for script in $path/"$RBENV_COMMAND"/*.bash; do
echo $script
done
done
shopt -u nullglob