Skip to content

Commit

Permalink
fix #986 and #989
Browse files Browse the repository at this point in the history
  • Loading branch information
Frooodle committed Mar 28, 2024
1 parent fb1baaa commit 08e43cc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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

Expand Down
34 changes: 19 additions & 15 deletions src/main/java/stirling/software/SPDF/utils/ProcessExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,26 +169,30 @@ public ProcessExecutorResult runCommandWithOutputHandling(
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
Expand Down

0 comments on commit 08e43cc

Please sign in to comment.