fix: set ASDF_INSTALL_* environment variables when running list-bin-paths script#2176
fix: set ASDF_INSTALL_* environment variables when running list-bin-paths script#2176atoato88 wants to merge 3 commits intoasdf-vm:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes asdf reshim’s invocation of the list-bin-paths plugin callback so it receives the documented ASDF_INSTALL_* environment variables, aligning behavior with the plugin authoring docs and resolving #2175.
Changes:
- Pass
ASDF_INSTALL_TYPE,ASDF_INSTALL_VERSION, andASDF_INSTALL_PATHto thelist-bin-pathscallback. - Update shims code to thread
confandversionintoExecutableDirsso it can compute and provide these env vars. - Add/adjust unit tests to validate env var availability and updated call signatures.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/shims/shims.go | Sets ASDF_INSTALL_* env vars when running list-bin-paths via ExecutableDirs. |
| internal/shims/shims_test.go | Updates ExecutableDirs tests for the new signature and adds coverage ensuring the callback can read ASDF_INSTALL_*. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| func TestExecutableDirs(t *testing.T) { | ||
| conf, plugin := generateConfig(t) | ||
| installVersion(t, conf, plugin, "1.2.3") | ||
| versionStruct := toolversions.Version{Type: "version", Value: "1.2.3"} |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes asdf reshim/shim generation behavior by ensuring the list-bin-paths plugin callback is executed with the documented ASDF_INSTALL_* environment variables available, aligning runtime behavior with plugin author expectations (per #2175).
Changes:
- Pass
ASDF_INSTALL_TYPE,ASDF_INSTALL_VERSION, andASDF_INSTALL_PATHwhen running thelist-bin-pathscallback. - Update
ExecutableDirsto acceptconfandversionso it can computeASDF_INSTALL_PATH. - Add/adjust tests to validate the new environment variables are exposed to
list-bin-paths.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| internal/shims/shims.go | Sets ASDF_INSTALL_* env vars when invoking the list-bin-paths callback and updates call sites accordingly. |
| internal/shims/shims_test.go | Updates tests for the new ExecutableDirs signature and adds a test asserting ASDF_INSTALL_* vars are visible in the callback. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| func TestExecutableDirs(t *testing.T) { | ||
| conf, plugin := generateConfig(t) | ||
| installVersion(t, conf, plugin, "1.2.3") | ||
| versionStruct := toolversions.Version{Type: "version", Value: "1.2.3"} |
| func TestExecutableDirs(t *testing.T) { | ||
| conf, plugin := generateConfig(t) | ||
| installVersion(t, conf, plugin, "1.2.3") | ||
| versionStruct := toolversions.Version{Type: "version", Value: "1.2.3"} |
| assert.Nil(t, err) | ||
|
|
||
| executables, err := ExecutableDirs(conf, plugin, versionStruct) | ||
| assert.Nil(t, err) |
|
Thanks for the PR @atoato88 ! Changes have been merged and will go out in the next patch release. |
|
Thank you for the comment. |
Summary
This PR sets
ASDF_INSTALL_*environment variables when runninglist-bin-pathsscript.See #2175 for detail.
Fixes: #2175