parse_electron_builder_appcast: s3 detection when no region (#71459)

This commit is contained in:
Vítor Galvão
2019-10-25 15:30:13 +01:00
committed by GitHub
parent 700641df95
commit 82202d31a1
+4 -4
View File
@@ -21,12 +21,12 @@ def parse(app_path)
when "s3"
bucket = data["bucket"]
channel = data["channel"]
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"
return "https://#{bucket}.s3.amazon-aws.yml/#{channel}/latest-mac.yml" if channel
return "https://s3-#{region}.amazonaws.com/#{bucket}/#{path}/latest-mac.yml" if region
return "https://s3.amazonaws.com/#{bucket}/#{path}/latest-mac.yml"
end
end