prepare_deploy: report which download has failed
Unified · Split
| @@ -244,11 +244,17 @@ class DocsCLI < Thor · 243 unmodified lines | |||
| 244 | FileUtils.mkpath(dir) | 244 | FileUtils.mkpath(dir) |
| 245 | 245 | ||
| 246 | ['index.json', 'meta.json'].each do |filename| | 246 | ['index.json', 'meta.json'].each do |filename| |
| 247 | open("https://docs.devdocs.io/#{doc.path}/#{filename}?#{time}") do |file| | 247 | json = "https://docs.devdocs.io/#{doc.path}/#{filename}?#{time}" |
| 248 | mutex.synchronize do | 248 | begin |
| 249 | path = File.join(dir, filename) | 249 | open(json) do |file| |
| 250 | File.write(path, file.read) | 250 | mutex.synchronize do |
| 251 | path = File.join(dir, filename) | ||
| 252 | File.write(path, file.read) | ||
| 253 | end | ||
| 251 | end | 254 | end |
| 255 | rescue => e | ||
| 256 | puts "Docs -- Failed to download #{json}!" | ||
| 257 | throw e | ||
| 252 | end | 258 | end |
| 253 | end | 259 | end |
| 254 | 260 | ||