-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
formula_creator: detect GitHub version from latest release #20025
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
base: master
Are you sure you want to change the base?
Conversation
b363843
to
0dff1e9
Compare
0dff1e9
to
ad976c4
Compare
9d4be72
to
25f480e
Compare
Fail in `parse_url`, where the missing @Version is parsed. `Version.detect()` returns `Version` object, and `@version` can only be `NULL` after it.
25f480e
to
825afde
Compare
Because it downloads actual archive instead of HTML page
user = Regexp.last_match(1) | ||
repo = Regexp.last_match(2) | ||
@github = GitHub.repository(user, repo) if @fetch | ||
when %r{github\.com/(\S+)/(\S+)/(archive|releases)/} |
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.
(archive|releases)
is still no longer handled
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.
@abitrolly Can you do this or close out the PR please? Please prioritise completing existing PRs before opening new ones.
Per review request to make sure it is called before write https://github.com/Homebrew/brew/pull/20025/files#r2123010882
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?If
--set-version
is absent, and version is not detected from URL, and the URL is GitHub URL, then fetch GitHub version from the latest release, and change URL to be tarball URL from the latest release.Also makes GitHub parsing more compact, and moves version check from
write!
toparse_url
where the detection logic is.So the data is collected from the two API calls:
$ curl -s https://api.github.com/repos/Homebrew/brew/releases/latest | jq