Update release script to upload assets in parallel

This commit is contained in:
Junegunn Choi 2017-01-22 18:33:30 +09:00
parent c4baa6a10c
commit 4d928001b8
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -23,7 +23,8 @@ end
# List assets
assets = Hash[rel['assets'].map { |a| a.values_at *%w[name id] }]
files.select { |f| File.exists? f }.each do |file|
files.select { |f| File.exists? f }.map do |file|
Thread.new do
name = File.basename file
if asset_id = assets[name]
@ -41,3 +42,4 @@ files.select { |f| File.exists? f }.each do |file|
:authorization => "token #{token}",
:content_type => "application/octet-stream")
end
end.each(&:join)