Automatically add ${RBENV_ROOT}/plugins/*/etc/rbenv.d to $RBENV_HOOK_PATH

This commit is contained in:
Sam Stephenson 2011-09-23 10:47:45 -05:00
parent 8ce5e84c21
commit 10084ae020

View file

@ -28,17 +28,21 @@ fi
export RBENV_ROOT export RBENV_ROOT
export RBENV_HOOK_PATH="${RBENV_HOOK_PATH}:${RBENV_ROOT}/rbenv.d:/usr/local/etc/rbenv.d:/etc/rbenv.d"
shopt -s nullglob shopt -s nullglob
rbenv_path="$(abs_dirname "$0")"
for plugin_bin in "${RBENV_ROOT}/plugins/"*/bin; do
rbenv_path="${rbenv_path}:${plugin_bin}"
done
shopt -u nullglob
export PATH="${rbenv_path}:${PATH}" bin_path="$(abs_dirname "$0")"
for plugin_bin in "${RBENV_ROOT}/plugins/"*/bin; do
bin_path="${bin_path}:${plugin_bin}"
done
export PATH="${bin_path}:${PATH}"
hook_path="${RBENV_HOOK_PATH}:${RBENV_ROOT}/rbenv.d:/usr/local/etc/rbenv.d:/etc/rbenv.d"
for plugin_hook in "${RBENV_ROOT}/plugins/"*/etc/rbenv.d; do
hook_path="${hook_path}:${plugin_hook}"
done
export RBENV_HOOK_PATH="$hook_path"
shopt -u nullglob
command="$1" command="$1"