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
.getShell()
.get()
.subShell(adjustedPath)
.subShell(processControl -> adjustedPath, (sc) -> adjustedPath)
.withInitSnippet(new SimpleScriptSnippet(
fileSystem
.getShell()

View file

@ -13,7 +13,6 @@ import java.util.UUID;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
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) {
return onFail(shellControl -> {
var s = store.getState();
@ -197,12 +188,9 @@ public interface ShellControl extends ProcessControl {
}
default ShellControl identicalSubShell() {
return subShell(p -> p.getShellDialect().getLoginOpenCommand(), (sc) -> sc.getShellDialect().getLoginOpenCommand())
.elevationPassword(getElevationPassword());
}
default ShellControl subShell(@NonNull String command) {
return subShell(processControl -> command, (sc) -> command);
return subShell(p -> p.getShellDialect().getLoginOpenCommand(),
(sc) -> sc.getShellDialect().getLoginOpenCommand()
).elevationPassword(getElevationPassword());
}
default <T> T enforceDialect(@NonNull ShellDialect type, FailableFunction<ShellControl, T, Exception> sc) throws Exception {