Fixes for sh connections [release]

This commit is contained in:
crschnick 2023-03-11 10:01:08 +00:00
parent a752b0c79a
commit eecafd3cf9
4 changed files with 13 additions and 5 deletions

View file

@ -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);

View file

@ -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,

View file

@ -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;
}
}

View file

@ -1 +1 @@
0.5.9
0.5.10