未验证 提交 59ada80c 编辑于 作者: Mike McQuaid's avatar Mike McQuaid 提交者: GitHub
浏览文件

Merge pull request #10863 from MikeMcQuaid/github_packages_bottle_domain

github_packages: fix HOMEBREW_BOTTLE_DOMAIN usage.
......@@ -13,7 +13,8 @@ class GitHubPackages
include Context
include Utils::Curl
URL_REGEX = %r{https://ghcr.io/v2/([\w-]+)/([\w-]+)}.freeze
URL_PREFIX = "https://ghcr.io/v2/"
URL_REGEX = %r{#{Regexp.escape(URL_PREFIX)}([\w-]+)/([\w-]+)}.freeze
sig { returns(String) }
def inspect
......
......@@ -379,7 +379,11 @@ class BottleSpecification
def root_url(var = nil, specs = {})
if var.nil?
@root_url ||= "#{Homebrew::EnvConfig.bottle_domain}/#{Utils::Bottles::Bintray.repository(tap)}"
@root_url ||= if Homebrew::EnvConfig.bottle_domain.start_with?(GitHubPackages::URL_PREFIX)
"#{GitHubPackages::URL_PREFIX}#{tap.full_name}"
else
"#{Homebrew::EnvConfig.bottle_domain}/#{Utils::Bottles::Bintray.repository(tap)}"
end
else
@root_url = var
@root_url_specs.merge!(specs)
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册