-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Download GitHub database: fix gh
invocation
#10923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I should clarify that this happens on Windows, in Git Bash. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be accurate
@jketema so how is this PR supposed to proceed from here? |
@dscho With gh version 2.74.2 it looks like that it works both with and without the |
When running `gh api /repos/...` in the Git Bash on Windows, it leads to a 404. The reason is the automatic path conversion from "Unix-y" paths on the command-line to proper Windows paths, as described in detail https://www.msys2.org/docs/filesystem-paths/. Git Bash simply has no chance to understnad that `/repos/...` is not referring to an absolute path on the local filesystem. Let's just skip the leading slash. This is as valid an invocation, and sidesteps that path conversion on Windows. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@jketema thank you for your response!
The crucial part is "on both macOS and Ubuntu", leaving out the still most prevalent platform: Windows.
Yes. The reason is described in https://www.msys2.org/docs/filesystem-paths/: Git Bash needs to automatically convert paths on the command-line which look like Unix paths to look like Windows paths instead, when calling a Win32 program (which I've updated the commit message to reflect this.
I guess you could use the |
@dscho thanks for your answer. Since either works on macOS and Ubuntu, I'm happy with this change. |
At least as of GitHub CLI v2.13.0, the leading slash in
gh api /repos/...
leads to a 404. In all GitHub CLI versions, the trailing slash ofgh api .../databases/
seems to not be acceptable, either.