From e554cd86c3d0bf2599cca93b5ccbd5ba019bc03d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 24 Dec 2015 18:33:39 +0100 Subject: [PATCH] Strip leading `:` from RBENV_HOOK_PATH --- libexec/rbenv | 1 + test/rbenv.bats | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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" }