BottleAPI: support :all bottles
This commit is contained in:
parent
98713e9cd1
commit
c5df900936
@ -66,7 +66,7 @@ module BottleAPI
|
|||||||
hash = fetch(name)
|
hash = fetch(name)
|
||||||
bottle_tag = Utils::Bottles.tag.to_s
|
bottle_tag = Utils::Bottles.tag.to_s
|
||||||
|
|
||||||
odie "No bottle available for current OS" unless hash["bottles"].key? bottle_tag
|
odie "No bottle available for current OS" if !hash["bottles"].key?(bottle_tag) && !hash["bottles"].key?("all")
|
||||||
|
|
||||||
download_bottle(hash, bottle_tag)
|
download_bottle(hash, bottle_tag)
|
||||||
|
|
||||||
@ -94,6 +94,7 @@ module BottleAPI
|
|||||||
sig { params(hash: Hash, tag: Symbol).void }
|
sig { params(hash: Hash, tag: Symbol).void }
|
||||||
def download_bottle(hash, tag)
|
def download_bottle(hash, tag)
|
||||||
bottle = hash["bottles"][tag]
|
bottle = hash["bottles"][tag]
|
||||||
|
bottle ||= hash["bottles"]["all"]
|
||||||
return if bottle.blank?
|
return if bottle.blank?
|
||||||
|
|
||||||
sha256 = bottle["sha256"] || checksum_from_url(bottle["url"])
|
sha256 = bottle["sha256"] || checksum_from_url(bottle["url"])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user