Choose the release archive file by tool name when installing - #111
Open
ZayanKhan-12 wants to merge 1 commit into
Open
Choose the release archive file by tool name when installing#111ZayanKhan-12 wants to merge 1 commit into
ZayanKhan-12 wants to merge 1 commit into
Conversation
Installation extracted the first entry of the release zip archive, so releases that also ship files like a license or a readme could install the wrong file entirely (e.g. Asphalt, whose archive lists LICENSE.md before the binary). Prefer an entry whose base name matches the tool name (with or without the platform executable suffix, case-insensitively, at any directory depth); otherwise take the first entry that does not look like documentation; and fall back to the first entry as before. Fixes Roblox#97 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #97
Problem
ToolCache::downloadextractedarchive.by_index(0)— literally the first entry of the release zip. Releases that also ship a license or readme can list those first, so foreman installs e.g.LICENSE.mdas the tool binary. That's exactly what breaks Asphalt installs, as reported.Fix
A
choose_zip_filehelper picks the entry to extract:asphaltorasphalt.exeforjackTabsCode/asphalt— case-insensitively and at any directory depth in the archive;.md/.txt/.rst/.html/.pdfextensions);Verification
choose_zip_file_prefers_the_tool_namecovering the Asphalt layout (LICENSE.md, README.md, asphalt→ picksasphalt), Windows.exenaming, nested/case-insensitive matches, documentation skipping, and both fallback pathscargo test --locked: all suites passcargo fmt -- --checkclean;cargo clippyintroduces no new warnings🤖 Generated with Claude Code