mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-22 18:23:34 +00:00
c3a5f91ed0
Expose a `version-origin` hook. It is invoked *before* the traditional `rbenv-version-file` lookup. Because `version-origin` is traditionally run immediately after `version-name`, then any plugin hooks that alter `version-name` would have done so. Thus, running `version-origin` prior to printing the origin gives those plugins a chance to alter the `version-origin` to match. If any of the hooks set `$RBENV_VERSION_ORIGIN`, then it is used as the return value. Otherwise, the existing logic continues to return "environment variable" or "filename" as appropriate. This change, in conjunction with the `version-name` hook, makes a clean seam by which plugins can inject their own ruby version setting logic. Using this seam, as opposed to altering `$RBENV_COMMAND_PATH` from the `which` hook, means that the version name and origin are set more reliably and so `version`, `version-name`, `version-origin` and `which` all work as expected. Indeed, even PS1 works now. |
||
---|---|---|
.. | ||
libexec | ||
--version.bats | ||
commands.bats | ||
completions.bats | ||
exec.bats | ||
global.bats | ||
help.bats | ||
hooks.bats | ||
init.bats | ||
local.bats | ||
prefix.bats | ||
rbenv.bats | ||
rehash.bats | ||
run | ||
shell.bats | ||
shims.bats | ||
test_helper.bash | ||
version-file-read.bats | ||
version-file-write.bats | ||
version-file.bats | ||
version-name.bats | ||
version-origin.bats | ||
version.bats | ||
versions.bats | ||
whence.bats | ||
which.bats |