mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-10-02 18:17:27 +13:00
More shell fixes
This commit is contained in:
parent
1ca9e2c751
commit
9f9eccffdd
2 changed files with 5 additions and 9 deletions
|
@ -64,8 +64,8 @@ public interface ShellProcessControl extends ProcessControl {
|
||||||
SecretValue getElevationPassword();
|
SecretValue getElevationPassword();
|
||||||
|
|
||||||
default ShellProcessControl subShell(@NonNull ShellType type) {
|
default ShellProcessControl subShell(@NonNull ShellType type) {
|
||||||
return subShell(p -> type.openCommand(), (shellProcessControl, s) -> {
|
return subShell(p -> type.getNormalOpenCommand(), (shellProcessControl, s) -> {
|
||||||
return s == null ? type.openCommand() : type.switchTo(s);
|
return s == null ? type.getNormalOpenCommand() : type.executeCommandWithShell(s);
|
||||||
})
|
})
|
||||||
.elevation(getElevationPassword());
|
.elevation(getElevationPassword());
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ public interface ShellType {
|
||||||
|
|
||||||
String createInitFileContent(String command);
|
String createInitFileContent(String command);
|
||||||
|
|
||||||
String getOpenWithInitFileCommand(String file);
|
String getFileOpenCommand(String file);
|
||||||
|
|
||||||
default String flatten(List<String> command) {
|
default String flatten(List<String> command) {
|
||||||
return command.stream()
|
return command.stream()
|
||||||
|
@ -48,10 +48,6 @@ public interface ShellType {
|
||||||
return ";";
|
return ";";
|
||||||
}
|
}
|
||||||
|
|
||||||
default String getAndConcatenationOperator() {
|
|
||||||
return "&&";
|
|
||||||
}
|
|
||||||
|
|
||||||
default String getOrConcatenationOperator() {
|
default String getOrConcatenationOperator() {
|
||||||
return "||";
|
return "||";
|
||||||
}
|
}
|
||||||
|
@ -74,9 +70,9 @@ public interface ShellType {
|
||||||
|
|
||||||
String getPrintVariableCommand(String prefix, String name);
|
String getPrintVariableCommand(String prefix, String name);
|
||||||
|
|
||||||
String openCommand();
|
String getNormalOpenCommand();
|
||||||
|
|
||||||
String switchTo(String cmd);
|
String executeCommandWithShell(String cmd);
|
||||||
|
|
||||||
List<String> createMkdirsCommand(String dirs);
|
List<String> createMkdirsCommand(String dirs);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue