dev-cmd/bump-formula-pr: fix for undetectable version

Currently, `brew bump-formula-pr` errors out without a proper message
when `--version` isn't specified and the formula's version cannot be parsed
from the URL. We fix this by returning early from `check_new_version` when the
detected version is Version::NULL.
This commit is contained in:
Nanda H Krishna 2022-01-20 19:19:28 -05:00
parent adc4da1604
commit 8b1fcc7c5c
No known key found for this signature in database
GPG Key ID: 067E5FCD58ADF3AA

View File

@ -436,6 +436,9 @@ module Homebrew
specs[:tag] = tag if tag.present? specs[:tag] = tag if tag.present?
version = Version.detect(url, **specs) version = Version.detect(url, **specs)
end end
return if version.null?
check_throttle(formula, version) check_throttle(formula, version)
check_closed_pull_requests(formula, tap_remote_repo, args: args, version: version) check_closed_pull_requests(formula, tap_remote_repo, args: args, version: version)
end end