fix(gh): correct exe-path for Windows platform#45
Merged
Conversation
The GitHub CLI Windows zip archives have never included a top-level
directory prefix. The archive structure is:
LICENSE
bin/gh.exe
While Linux (.tar.gz) and macOS (.zip) archives include a
`gh_{version}_{os}_{arch}/` prefix directory, the Windows zip does not.
This caused proto to fail with:
Unable to find an executable for GitHub CLI, expected file
~/.proto/tools/gh/{version}/gh_{version}_windows_{arch}/bin/gh.exe
does not exist.
Fix the Windows exe-path from `gh_{version}_windows_{arch}/bin/gh.exe`
to `bin/gh.exe` to match the actual archive layout.
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.
Summary
exe-pathfor[platform.windows]in the gh plugin fromgh_{version}_windows_{arch}/bin/gh.exetobin/gh.exeLICENSE,bin/gh.exe), unlike Linux (.tar.gz) and macOS (.zip) which do include thegh_{version}_{os}_{arch}/prefixProblem
Installing the gh CLI via proto on Windows fails with:
This happens because the plugin assumes the Windows zip has the same directory structure as Linux/macOS, but it does not. I verified multiple releases going back to v2.20.0 — the Windows zip has always been flat:
While Linux and macOS archives include the prefix:
Related
ghfails to install on version0.42.0of proto #31 (which was fixed for macOS in Fix exe paths #34 but not Windows)