diff --git a/libexec/rbenv-init b/libexec/rbenv-init index 5f9079a7..fbffb85f 100755 --- a/libexec/rbenv-init +++ b/libexec/rbenv-init @@ -92,22 +92,13 @@ fi mkdir -p "${RBENV_ROOT}/"{shims,versions} -if [[ ":${PATH}:" != *:"${RBENV_ROOT}/shims":* ]]; then - case "$shell" in - fish ) - echo "setenv PATH '${RBENV_ROOT}/shims' \$PATH" - ;; - * ) - echo 'export PATH="'${RBENV_ROOT}'/shims:${PATH}"' - ;; - esac -fi - case "$shell" in fish ) + echo "setenv PATH '${RBENV_ROOT}/shims' \$PATH" echo "setenv RBENV_SHELL $shell" ;; * ) + echo 'export PATH="'${RBENV_ROOT}'/shims:${PATH}"' echo "export RBENV_SHELL=$shell" ;; esac diff --git a/libexec/rbenv-realpath.dylib b/libexec/rbenv-realpath.dylib new file mode 100755 index 00000000..c42aca38 Binary files /dev/null and b/libexec/rbenv-realpath.dylib differ diff --git a/test/init.bats b/test/init.bats index aa50f091..78a762f1 100644 --- a/test/init.bats +++ b/test/init.bats @@ -64,11 +64,11 @@ load test_helper assert_line 0 "setenv PATH '${RBENV_ROOT}/shims' \$PATH" } -@test "doesn't add shims to PATH more than once" { +@test "can add shims to PATH more than once" { export PATH="${RBENV_ROOT}/shims:$PATH" run rbenv-init - bash assert_success - refute_line 'export PATH="'${RBENV_ROOT}'/shims:${PATH}"' + assert_line 0 'export PATH="'${RBENV_ROOT}'/shims:${PATH}"' } @test "doesn't add shims to PATH more than once (fish)" {