1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 00:17:11 -07:00

Better display.

This commit is contained in:
Cedric Beust 2015-10-15 03:27:27 -07:00
parent 814777e553
commit 806628be4a

View file

@ -140,15 +140,17 @@ public class JCenterApi @Inject constructor (@Nullable @Assisted("username") val
+ if (fileCount > 1) "..." else "")
var i = 1
val errorMessages = arrayListOf<String>()
var dots = ""
filesToUpload.forEach { file ->
http.uploadFile(username, password, fileToPath(file) + optionPath, file,
{ },
{ r: Response -> dots += "."},
{ r: Response ->
dots += "X"
val jo = parseResponse(r.body().string())
errorMessages.add(jo.string("message") ?: "No message found")
})
val end = if (i >= fileCount) "\n" else ""
log(1, " Uploading " + (i++) + " / $fileCount$end", false)
log(1, " Uploading " + (i++) + " / $fileCount$end $dots", false)
}
if (errorMessages.isEmpty()) {
return TaskResult()