Merge pull request #88 from alexarchambault/topic/develop

Fix minor glitches
This commit is contained in:
Alexandre Archambault 2015-12-03 12:50:35 +01:00
commit 47ae9210ae
2 changed files with 6 additions and 3 deletions

View File

@ -41,7 +41,11 @@ class TermDisplay(out: Writer) extends Logger {
for ((url, info) <- downloads0) {
assert(info != null, s"Incoherent state ($url)")
val pctOpt = info.pct.map(100.0 * _)
val extra = s"(${pctOpt.map(pct => f"$pct%.2f %%, ").mkString}${info.downloaded}${info.length.map(" / " + _).mkString})"
val extra =
if (info.length.isEmpty && info.downloaded == 0L)
""
else
s"(${pctOpt.map(pct => f"$pct%.2f %%, ").mkString}${info.downloaded}${info.length.map(" / " + _).mkString})"
val total = url.length + 1 + extra.length
val (url0, extra0) =

View File

@ -90,8 +90,6 @@ case class Files(
def remote(file: File, url: String) =
Task {
try {
file.getParentFile.mkdirs()
logger.foreach(_.downloadingArtifact(url))
val conn = new URL(url).openConnection() // FIXME Should this be closed?
@ -108,6 +106,7 @@ case class Files(
val result =
try {
file.getParentFile.mkdirs()
val out = new FileOutputStream(file)
try {
var lock: FileLock = null