This will help people running on asdf master be able to report
issues and maintainers can know the precise git commit where the
error was reported.
See #589
With the previous version, the following case would fail.
It would use python 2.7.15 when running pip
instead of version 3.7.2.
Shim for `pip`
```bash
exec /home/daniel/.asdf/bin/asdf exec "pip" "$@"
```
`.tool-versions`:
```
python 3.7.2 2.7.15 system
```
- Make shim-exec, shim-env, and which use the same logic to look for commands
- Make sure shim-exec and which use a plugin exec-path hook as documented
(the hook takes a relative path to the executable and returns also
a relative path, possibly modified)
- Fix shellchecks
Suppose a `foo` plugin is installed and provides a `bar` executable.
The following hooks will be executed when set in `.asdfrc`:
```shell
post_asdf_install_foo = echo installed foo version ${1}
post_asdf_reshim_foo = echo reshimmed foo version ${1}
pre_foo_bar = echo about to execute command bar from foo with args: ${@}
post_foo_bar = echo just executed command bar from foo with args: ${@}
```
Features
* New shim version meta-data allows shims to not depend on a particular plugin
nor on its relative executable path (#431)
Upgrading requires shim re-generation and should happen automatically
by `asdf-exec`:
`rm -rf ~/.asdf/shims/` followed by `asdf reshim`
* Added lots of tests for shim execution.
We now make sure that shim execution obeys plugins hooks like
`list-bin-paths` and `exec-path`.
* Shim exec is now performed by a new `bin/private/asdf-tool-exec` that might
be faster for most common use case: (versions on local .tool-versions file)
but fallbacks to slower `get_preset_version_for` which takes legacy formats
into account.
* Shim exec recommends which plugins or versions to set when command is
not found.
Fixed Bugs
* Allow many plugins to provide shims with same executable name (#431)
Previously, if we ran a command like `asdf install` and we encountered a
plugin that didn't exist, asdf produces an error saying "No such
plugin". Without knowing which plugin it could be referring too, we'd
have to manually go through each plugin in `.tool-versions` to find the
culprit.
With this commit, we'll now also include the plugin name as part of the
messaging for easier debugging.