fix displaying of errors (e.g. no rpmbuild)

This commit is contained in:
Anton Keks 2025-08-13 17:11:44 +03:00
parent bfdbd05ff5
commit f2f79cdcbf

View File

@ -22,7 +22,7 @@ String exec(def line, String dir = ".", boolean failOnError = true) {
def proc = Runtime.getRuntime().exec(line, null, project.file(dir))
if (proc.waitFor() == 0) return new String(proc.inputStream.readAllBytes()).trim()
else {
if (failOnError) throw new Exception(line + "\n" + new String(proc.errorStream.readAllBytes()))
if (failOnError) throw new Exception(line.toString() + "\n" + new String(proc.errorStream.readAllBytes()))
else return null
}
}