From 08e43cc89c6b22a8986e4a08f71dc619060a1be5 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com.> Date: Thu, 28 Mar 2024 17:09:21 +0000 Subject: [PATCH] fix #986 and #989 --- build.gradle | 4 +-- .../software/SPDF/utils/ProcessExecutor.java | 34 +++++++++++-------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index b4580d88..03a022b1 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ plugins { import com.github.jk1.license.render.* group = 'stirling.software' -version = '0.22.4' +version = '0.22.5' sourceCompatibility = '17' repositories { @@ -128,7 +128,7 @@ dependencies { // implementation 'com.twelvemonkeys.imageio:imageio-xwd:3.10.1' implementation 'commons-io:commons-io:2.15.1' - implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.4.0' + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0' //general PDF diff --git a/src/main/java/stirling/software/SPDF/utils/ProcessExecutor.java b/src/main/java/stirling/software/SPDF/utils/ProcessExecutor.java index 595ada58..664d01a1 100644 --- a/src/main/java/stirling/software/SPDF/utils/ProcessExecutor.java +++ b/src/main/java/stirling/software/SPDF/utils/ProcessExecutor.java @@ -169,26 +169,30 @@ public class ProcessExecutor { errorReaderThread.join(); outputReaderThread.join(); - if (!liveUpdates) { - if (outputLines.size() > 0) { - String outputMessage = String.join("\n", outputLines); - messages += outputMessage; + if (outputLines.size() > 0) { + String outputMessage = String.join("\n", outputLines); + messages += outputMessage; + if (!liveUpdates) { logger.info("Command output:\n" + outputMessage); } + } - if (errorLines.size() > 0) { - String errorMessage = String.join("\n", errorLines); - messages += errorMessage; + if (errorLines.size() > 0) { + String errorMessage = String.join("\n", errorLines); + messages += errorMessage; + if (!liveUpdates) { logger.warn("Command error output:\n" + errorMessage); - if (exitCode != 0) { - throw new IOException( - "Command process failed with exit code " - + exitCode - + ". Error message: " - + errorMessage); - } } - } else if (exitCode != 0) { + if (exitCode != 0) { + throw new IOException( + "Command process failed with exit code " + + exitCode + + ". Error message: " + + errorMessage); + } + } + + if (exitCode != 0) { throw new IOException( "Command process failed with exit code " + exitCode