diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/rife/bld/extension/ExecOperation.java b/src/main/java/rife/bld/extension/ExecOperation.java index fb83ceb..cb78a5d 100644 --- a/src/main/java/rife/bld/extension/ExecOperation.java +++ b/src/main/java/rife/bld/extension/ExecOperation.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.*; import java.util.concurrent.TimeUnit; +import java.util.logging.Level; import java.util.logging.Logger; /** @@ -75,6 +76,10 @@ public class ExecOperation extends AbstractOperation { pb.command(args_); pb.directory(workDir); + if (LOGGER.isLoggable(Level.INFO)) { + LOGGER.info(String.join(" ", args_)); + } + var proc = pb.start(); var err = proc.waitFor(30, TimeUnit.SECONDS); var stdout = readStream(proc.getInputStream()); @@ -99,6 +104,12 @@ public class ExecOperation extends AbstractOperation { errorMessage.append("STDOUT -> ").append(stdout.get(0)); } } + + if (LOGGER.isLoggable(Level.INFO) && errorMessage.isEmpty() && !stdout.isEmpty()) { + for (var l : stdout) { + LOGGER.info(l); + } + } } else { errorMessage.append("Invalid working directory: ").append(workDir.getCanonicalPath()); }