Download GitHub database: fix gh invocation#10923
Conversation
|
I should clarify that this happens on Windows, in Git Bash. |
smowton
left a comment
There was a problem hiding this comment.
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.