Skip to content

fix: convert hyphens to underscores when converting plugin names to generate valid environment variables#2194

Closed
mgrechukh wants to merge 2 commits intoasdf-vm:masterfrom
mgrechukh:fix-multiword-tools
Closed

fix: convert hyphens to underscores when converting plugin names to generate valid environment variables#2194
mgrechukh wants to merge 2 commits intoasdf-vm:masterfrom
mgrechukh:fix-multiword-tools

Conversation

@mgrechukh
Copy link
Copy Markdown
Contributor

Summary

In pre-0.16.0 shell implementation, tool name consisting of multiple words, separated by dash, were sanitized as environment variable. I.e. for "teleport-community" we have "ASDF_TELEPORT_COMMUNITY_VERSION"

As now toolName passed to variable name unmodified which breaks certain usage scenarios. Although variable containing dash "ASDF_TELEPORT-COMMUNITY_VERSION" sometimes can be set in surrounding code, it is clumsy.

This patch restores the old behaviour.

@mgrechukh mgrechukh requested a review from a team as a code owner October 12, 2025 05:26
@mgrechukh mgrechukh changed the title sanitize toolName for shell variable fix: sanitize toolName for shell variable Oct 28, 2025
@mgrechukh mgrechukh changed the title fix: sanitize toolName for shell variable fix: resolves asdf-vm/asdf#2204 Nov 3, 2025
@mgrechukh mgrechukh force-pushed the fix-multiword-tools branch from 1b4cec3 to 67a60c3 Compare November 3, 2025 13:11
@mgrechukh mgrechukh marked this pull request as draft November 3, 2025 13:12
@mgrechukh mgrechukh marked this pull request as ready for review November 3, 2025 13:13
Copy link
Copy Markdown
Member

@Stratus3D Stratus3D left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the extremely late review here @mgrechukh ! This is a good fix, but we need to have tests before I can merge. I'm going to try to write tests for this myself.

@Stratus3D Stratus3D changed the title fix: resolves asdf-vm/asdf#2204 fix: convert hyphens to underscores when converting plugin names to environment variables Apr 17, 2026
@Stratus3D Stratus3D changed the title fix: convert hyphens to underscores when converting plugin names to environment variables fix: convert hyphens to underscores when converting plugin names to generate valid environment variables Apr 17, 2026
@Stratus3D
Copy link
Copy Markdown
Member

Thanks for the PR @mgrechukh ! The changes have been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants