bottle: Elide root_url only if it is the default

Elide root_url only if it is precisely equal to the default root_url.
Eliding root_url when a prefix matches the default also elides
a custom root_url such as https://linuxbrew.bintray.com/bottles-bio.
This commit is contained in:
Shaun Jackman 2020-01-26 22:01:02 -08:00
parent 31aaf48322
commit 7f4c7e0afc

View File

@ -11,7 +11,7 @@ require "erb"
BOTTLE_ERB = <<-EOS
bottle do
<% if !root_url.start_with?(HOMEBREW_BOTTLE_DEFAULT_DOMAIN) %>
<% if root_url != "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}/bottles" %>
root_url "<%= root_url %>"
<% end %>
<% if ![HOMEBREW_DEFAULT_PREFIX, LINUXBREW_DEFAULT_PREFIX].include?(prefix) %>