pull: fix --legacy for legacy-homebrew repo
This commit is contained in:
parent
eec323aed8
commit
e158b5e4b1
@ -56,10 +56,12 @@ module Homebrew
|
|||||||
elsif (api_match = arg.match HOMEBREW_PULL_API_REGEX)
|
elsif (api_match = arg.match HOMEBREW_PULL_API_REGEX)
|
||||||
_, user, repo, issue = *api_match
|
_, user, repo, issue = *api_match
|
||||||
url = "https://github.com/#{user}/#{repo}/pull/#{issue}"
|
url = "https://github.com/#{user}/#{repo}/pull/#{issue}"
|
||||||
tap = Tap.fetch(user, repo) if repo.start_with?("homebrew-") || ARGV.include?("--legacy")
|
tap = Tap.fetch(user, repo) if repo.start_with?("homebrew-")
|
||||||
|
tap = CoreTap.instance if ARGV.include?("--legacy")
|
||||||
elsif (url_match = arg.match HOMEBREW_PULL_OR_COMMIT_URL_REGEX)
|
elsif (url_match = arg.match HOMEBREW_PULL_OR_COMMIT_URL_REGEX)
|
||||||
url, user, repo, issue = *url_match
|
url, user, repo, issue = *url_match
|
||||||
tap = Tap.fetch(user, repo) if repo.start_with?("homebrew-") || ARGV.include?("--legacy")
|
tap = Tap.fetch(user, repo) if repo.start_with?("homebrew-")
|
||||||
|
tap = CoreTap.instance if ARGV.include?("--legacy")
|
||||||
else
|
else
|
||||||
odie "Not a GitHub pull request or commit: #{arg}"
|
odie "Not a GitHub pull request or commit: #{arg}"
|
||||||
end
|
end
|
||||||
@ -68,10 +70,6 @@ module Homebrew
|
|||||||
odie "No pull request detected!"
|
odie "No pull request detected!"
|
||||||
end
|
end
|
||||||
|
|
||||||
if ARGV.include?("--legacy") && !tap.core_tap?
|
|
||||||
odie "--legacy can only be used for CoreTap!"
|
|
||||||
end
|
|
||||||
|
|
||||||
if tap
|
if tap
|
||||||
tap.install unless tap.installed?
|
tap.install unless tap.installed?
|
||||||
Dir.chdir tap.path
|
Dir.chdir tap.path
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user