Browse Source

Search for plugins in PYENV_DIR and PYENV_ROOT (#1697)

pull/1814/head
cornfeedhobo 4 years ago
committed by GitHub
parent
commit
cadebd8e65
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions
  1. +4
    -1
      libexec/pyenv
  2. +2
    -1
      test/pyenv.bats

+ 4
- 1
libexec/pyenv View File

@ -94,7 +94,10 @@ export PYENV_DIR
shopt -s nullglob
bin_path="$(abs_dirname "$0")"
for plugin_bin in "${PYENV_ROOT}/plugins/"*/bin; do
for plugin_bin in "${bin_path%/*}"/plugins/*/bin; do
PATH="${plugin_bin}:${PATH}"
done
for plugin_bin in "${PYENV_ROOT}"/plugins/*/bin; do
PATH="${plugin_bin}:${PATH}"
done
export PATH="${bin_path}:${PATH}"

+ 2
- 1
test/pyenv.bats View File

@ -48,7 +48,7 @@ load test_helper
@test "adds its own libexec to PATH" {
run pyenv echo "PATH"
assert_success "${BATS_TEST_DIRNAME%/*}/libexec:$PATH"
assert_success "${BATS_TEST_DIRNAME%/*}/libexec:${BATS_TEST_DIRNAME%/*}/plugins/python-build/bin:$PATH"
}
@test "adds plugin bin dirs to PATH" {
@ -59,6 +59,7 @@ load test_helper
assert_line 0 "${BATS_TEST_DIRNAME%/*}/libexec"
assert_line 1 "${PYENV_ROOT}/plugins/python-build/bin"
assert_line 2 "${PYENV_ROOT}/plugins/pyenv-each/bin"
assert_line 3 "${BATS_TEST_DIRNAME%/*}/plugins/python-build/bin"
}
@test "PYENV_HOOK_PATH preserves value from environment" {

Loading…
Cancel
Save