script/travis-logs in moneta-0.7.19 vs script/travis-logs in moneta-0.7.20
- old
+ new
@@ -3,10 +3,11 @@
require 'cgi'
require 'fileutils'
FileUtils.mkpath('logs')
`git remote -v | grep origin | head -n1` =~ /github\.com:(.*?)\.git/
repo = Travis::Repository.find($1)
-repo.last_build.jobs.each do |j|
+build = repo.recent_builds.select {|b| b.finished_at }.first
+build.jobs.each do |j|
c = j.config
id = "logs/#{j.allow_failures? ? 'allowed-' : ''}#{j.state}-#{c['rvm']}-#{CGI.escape c['env']}"
puts "Downloading #{j.id}"
File.open(id, 'w') {|f| f.write(j.log.body) }
end