diff --git a/libexec/rbenv b/libexec/rbenv index 795a2e9a..1ad36c95 100755 --- a/libexec/rbenv +++ b/libexec/rbenv @@ -84,6 +84,7 @@ RBENV_HOOK_PATH="${RBENV_HOOK_PATH}:/usr/local/etc/rbenv.d:/etc/rbenv.d:/usr/lib for plugin_hook in "${RBENV_ROOT}/plugins/"*/etc/rbenv.d; do RBENV_HOOK_PATH="${RBENV_HOOK_PATH}:${plugin_hook}" done +RBENV_HOOK_PATH="${RBENV_HOOK_PATH#:}" export RBENV_HOOK_PATH shopt -u nullglob diff --git a/test/rbenv.bats b/test/rbenv.bats index 4e6b32b0..6ded889c 100644 --- a/test/rbenv.bats +++ b/test/rbenv.bats @@ -71,5 +71,5 @@ load test_helper @test "RBENV_HOOK_PATH includes rbenv built-in plugins" { run rbenv echo "RBENV_HOOK_PATH" - assert_success ":${RBENV_ROOT}/rbenv.d:${BATS_TEST_DIRNAME%/*}/rbenv.d:/usr/local/etc/rbenv.d:/etc/rbenv.d:/usr/lib/rbenv/hooks" + assert_success "${RBENV_ROOT}/rbenv.d:${BATS_TEST_DIRNAME%/*}/rbenv.d:/usr/local/etc/rbenv.d:/etc/rbenv.d:/usr/lib/rbenv/hooks" }