From 96b98ed039ae39fc386d2c93dc3568df6973ec35 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Wed, 21 Sep 2011 12:38:58 -0500 Subject: [PATCH] Use plugin-scripts --- libexec/rbenv-exec | 8 ++------ libexec/rbenv-rehash | 8 ++------ libexec/rbenv-which | 8 ++------ 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/libexec/rbenv-exec b/libexec/rbenv-exec index ac060196..d940a7a3 100755 --- a/libexec/rbenv-exec +++ b/libexec/rbenv-exec @@ -16,12 +16,8 @@ fi RBENV_COMMAND_PATH="$(rbenv-which "$RBENV_COMMAND")" RBENV_BIN_PATH="${RBENV_COMMAND_PATH%/*}" -shopt -s nullglob -RBENV_EXEC_PLUGINS=(/etc/rbenv.d/exec/*.bash ${RBENV_ROOT}/rbenv.d/exec/*.bash) -shopt -u nullglob - -for script in ${RBENV_EXEC_PLUGINS[@]}; do - source $script +for script in $(rbenv-plugin-scripts exec); do + source $script; done shift 1 diff --git a/libexec/rbenv-rehash b/libexec/rbenv-rehash index 3d9a9a70..a11b64bd 100755 --- a/libexec/rbenv-rehash +++ b/libexec/rbenv-rehash @@ -67,13 +67,9 @@ create_prototype_shim shopt -s nullglob make_shims ../versions/*/bin/* -# Find and run any plugins that might want to make shims too. -RBENV_REHASH_PLUGINS=(/etc/rbenv.d/rehash/*.bash ${RBENV_ROOT}/rbenv.d/rehash/*.bash) -shopt -u nullglob - # Restore the previous working directory. cd "$CUR_PATH" -for script in ${RBENV_REHASH_PLUGINS[@]}; do - source $script +for script in $(rbenv-plugin-scripts rehash); do + source $script; done diff --git a/libexec/rbenv-which b/libexec/rbenv-which index 4ba82678..a47badd3 100755 --- a/libexec/rbenv-which +++ b/libexec/rbenv-which @@ -52,12 +52,8 @@ else RBENV_COMMAND_PATH="${RBENV_ROOT}/versions/${RBENV_VERSION}/bin/${RBENV_COMMAND}" fi -shopt -s nullglob -RBENV_WHICH_PLUGINS=(/etc/rbenv.d/which/*.bash ${RBENV_ROOT}/rbenv.d/which/*.bash) -shopt -u nullglob - -for script in ${RBENV_WHICH_PLUGINS[@]}; do - source $script +for script in $(rbenv-plugin-scripts which); do + source $script; done if [ -x "$RBENV_COMMAND_PATH" ]; then