diff --git a/core/src/main/java/io/xpipe/core/process/CommandControl.java b/core/src/main/java/io/xpipe/core/process/CommandControl.java index 31f95e0d..c487d007 100644 --- a/core/src/main/java/io/xpipe/core/process/CommandControl.java +++ b/core/src/main/java/io/xpipe/core/process/CommandControl.java @@ -7,6 +7,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.nio.charset.Charset; +import java.util.Optional; import java.util.function.Consumer; import java.util.function.Function; @@ -90,6 +91,8 @@ public interface CommandControl extends ProcessControl { String readStdoutAndWait() throws Exception; + Optional readStdoutIfPossible() throws Exception; + default boolean discardAndCheckExit() throws ProcessOutputException { try { discardOrThrow();