mirror of
https://github.com/wavetermdev/homebrew-cask.git
synced 2026-08-05 13:43:24 -07:00
parse_electron_builder_appcast: support s3 buckets without a channel (#71143)
This commit is contained in:
committed by
Markus Reiter
parent
431b865662
commit
aacb65a1ec
@@ -13,15 +13,20 @@ def parse(app_path)
|
||||
case data["provider"]
|
||||
when "generic"
|
||||
url = data["url"]
|
||||
puts "#{url}/latest-mac.yml"
|
||||
"#{url}/latest-mac.yml"
|
||||
when "github"
|
||||
owner = data["owner"]
|
||||
repo = data["repo"]
|
||||
puts "https://github.com/#{owner}/#{repo}/releases.atom"
|
||||
"https://github.com/#{owner}/#{repo}/releases.atom"
|
||||
when "s3"
|
||||
bucket = data["bucket"]
|
||||
channel = data["channel"]
|
||||
puts "https://#{bucket}.s3.amazon-aws.yml/#{channel}/latest-mac.yml"
|
||||
|
||||
return "https://#{bucket}.s3.amazon-aws.yml/#{channel}/latest-mac.yml" if channel
|
||||
|
||||
region = data["region"]
|
||||
path = data["path"].sub(%r{^/(.*)/$}, '\1')
|
||||
"https://s3-#{region}.amazonaws.com/#{bucket}/#{path}/latest-mac.yml"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -42,4 +47,4 @@ unless ARGV.length == 1
|
||||
exit 1
|
||||
end
|
||||
|
||||
parse(ARGV[0])
|
||||
puts parse(ARGV[0])
|
||||
|
||||
Reference in New Issue
Block a user