From 07ac15cc38e38bcb3b686caa119bf9b22ac8c68e Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Wed, 14 Oct 2015 20:15:55 -0700 Subject: [PATCH] Handle absence of gpg better. --- src/main/kotlin/com/beust/kobalt/maven/Gpg.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/maven/Gpg.kt b/src/main/kotlin/com/beust/kobalt/maven/Gpg.kt index 25a170b9..cac3b10a 100644 --- a/src/main/kotlin/com/beust/kobalt/maven/Gpg.kt +++ b/src/main/kotlin/com/beust/kobalt/maven/Gpg.kt @@ -38,10 +38,8 @@ public class Gpg { if (gpg != null) { val directory = files.get(0).parentFile.absoluteFile files.forEach { file -> - with(File(directory, file.absolutePath + ".asc")) { - delete() - result.add(this) - } + val ascFile = File(directory, file.absolutePath + ".asc") + ascFile.delete() val allArgs = arrayListOf() allArgs.add(gpg) allArgs.add("-ab") @@ -60,11 +58,13 @@ public class Gpg { error(line) line = br.readLine() } - throw KobaltException("Couldn't sign file $file") + warn("Couldn't sign file $file") + } else { + result.add(ascFile) } } - return files.map { File(it.absolutePath + ".asc") } + return result } else { warn("Couldn't find the gpg command, make sure it is on your PATH") warn("Signing of artifacts with PGP (.asc) disabled")