mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-06-24 17:10:19 +12:00
Fixes for sh connections [release]
This commit is contained in:
parent
a752b0c79a
commit
eecafd3cf9
|
@ -35,10 +35,10 @@ public class FileStoreChoiceComp extends SimpleComp {
|
|||
var fileProperty = new SimpleStringProperty(
|
||||
selected.getValue() != null ? selected.getValue().getPath() : null);
|
||||
fileProperty.addListener((observable, oldValue, newValue) -> {
|
||||
setSelected(selected.getValue().getFileSystem(), newValue);
|
||||
setSelected(selected.getValue() != null ? selected.getValue().getFileSystem() : null, newValue);
|
||||
});
|
||||
selected.addListener((observable, oldValue, newValue) -> {
|
||||
fileProperty.setValue(newValue.getPath());
|
||||
fileProperty.setValue(newValue != null ? newValue.getPath() : null);
|
||||
});
|
||||
|
||||
var fileSystemChoiceComp = new FileSystemStoreChoiceComp(selected).grow(false, true).styleClass(Styles.LEFT_PILL);
|
||||
|
|
|
@ -11,6 +11,10 @@ import java.util.function.Consumer;
|
|||
|
||||
public interface CommandControl extends ProcessControl {
|
||||
|
||||
public static final int UNASSIGNED_EXIT_CODE = -1;
|
||||
public static final int TIMEOUT_EXIT_CODE = -2;
|
||||
public static final int KILLED_EXIT_CODE = -3;
|
||||
|
||||
static enum TerminalExitMode {
|
||||
KEEP_OPEN,
|
||||
KEEP_OPEN_ON_FAILURE,
|
||||
|
|
|
@ -13,7 +13,7 @@ public class ProcessOutputException extends Exception {
|
|||
|
||||
public static ProcessOutputException of(int exitCode, String output) {
|
||||
var messageSuffix = output != null && !output.isBlank()?": " + output : "";
|
||||
var message = exitCode == -1 ? "Process timed out" + messageSuffix : "Process returned with exit code " + exitCode + messageSuffix;
|
||||
var message = exitCode == CommandControl.TIMEOUT_EXIT_CODE ? "Process timed out" + messageSuffix : "Process returned with exit code " + exitCode + messageSuffix;
|
||||
return new ProcessOutputException(message, exitCode, output);
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,10 @@ public class ProcessOutputException extends Exception {
|
|||
}
|
||||
|
||||
public boolean isTimeOut() {
|
||||
return exitCode == -1;
|
||||
return exitCode == CommandControl.TIMEOUT_EXIT_CODE;
|
||||
}
|
||||
|
||||
public boolean isKill() {
|
||||
return exitCode == CommandControl.KILLED_EXIT_CODE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue