Cleanup shell control

This commit is contained in:
crschnick 2023-12-30 02:20:21 +00:00
parent 1757684c79
commit 16071c0e75
2 changed files with 4 additions and 16 deletions

View file

@ -162,7 +162,7 @@ public final class OpenFileSystemModel {
fileSystem fileSystem
.getShell() .getShell()
.get() .get()
.subShell(adjustedPath) .subShell(processControl -> adjustedPath, (sc) -> adjustedPath)
.withInitSnippet(new SimpleScriptSnippet( .withInitSnippet(new SimpleScriptSnippet(
fileSystem fileSystem
.getShell() .getShell()

View file

@ -13,7 +13,6 @@ import java.util.UUID;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Consumer; import java.util.function.Consumer;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Predicate;
public interface ShellControl extends ProcessControl { public interface ShellControl extends ProcessControl {
@ -62,14 +61,6 @@ public interface ShellControl extends ProcessControl {
}); });
} }
default ShellControl withSupportCheckInit(Predicate<ShellControl> predicate, String name) {
return onInit(shellControl -> {
if (!predicate.test(shellControl)) {
}
});
}
default <T extends ShellStoreState> ShellControl withShellStateFail(StatefulDataStore<T> store) { default <T extends ShellStoreState> ShellControl withShellStateFail(StatefulDataStore<T> store) {
return onFail(shellControl -> { return onFail(shellControl -> {
var s = store.getState(); var s = store.getState();
@ -197,12 +188,9 @@ public interface ShellControl extends ProcessControl {
} }
default ShellControl identicalSubShell() { default ShellControl identicalSubShell() {
return subShell(p -> p.getShellDialect().getLoginOpenCommand(), (sc) -> sc.getShellDialect().getLoginOpenCommand()) return subShell(p -> p.getShellDialect().getLoginOpenCommand(),
.elevationPassword(getElevationPassword()); (sc) -> sc.getShellDialect().getLoginOpenCommand()
} ).elevationPassword(getElevationPassword());
default ShellControl subShell(@NonNull String command) {
return subShell(processControl -> command, (sc) -> command);
} }
default <T> T enforceDialect(@NonNull ShellDialect type, FailableFunction<ShellControl, T, Exception> sc) throws Exception { default <T> T enforceDialect(@NonNull ShellDialect type, FailableFunction<ShellControl, T, Exception> sc) throws Exception {