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

Handle absence of gpg better.

This commit is contained in:
Cedric Beust 2015-10-14 20:15:55 -07:00
parent 0867b102cc
commit 07ac15cc38

View file

@ -38,10 +38,8 @@ public class Gpg {
if (gpg != null) { if (gpg != null) {
val directory = files.get(0).parentFile.absoluteFile val directory = files.get(0).parentFile.absoluteFile
files.forEach { file -> files.forEach { file ->
with(File(directory, file.absolutePath + ".asc")) { val ascFile = File(directory, file.absolutePath + ".asc")
delete() ascFile.delete()
result.add(this)
}
val allArgs = arrayListOf<String>() val allArgs = arrayListOf<String>()
allArgs.add(gpg) allArgs.add(gpg)
allArgs.add("-ab") allArgs.add("-ab")
@ -60,11 +58,13 @@ public class Gpg {
error(line) error(line)
line = br.readLine() 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 { } else {
warn("Couldn't find the gpg command, make sure it is on your PATH") warn("Couldn't find the gpg command, make sure it is on your PATH")
warn("Signing of artifacts with PGP (.asc) disabled") warn("Signing of artifacts with PGP (.asc) disabled")