mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 00:50:31 +00:00
Fix ssh git integration
This commit is contained in:
parent
102b69f261
commit
3afbb2ed0a
1 changed files with 23 additions and 0 deletions
|
@ -62,6 +62,14 @@ public class CommandBuilder {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public CommandBuilder add(int index, String... s) {
|
||||||
|
for (String s1 : s) {
|
||||||
|
elements.add(index++, new Fixed(s1));
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public CommandBuilder remove(String s) {
|
public CommandBuilder remove(String s) {
|
||||||
elements.removeIf(element -> element instanceof Fixed fixed && s.equals(fixed.string));
|
elements.removeIf(element -> element instanceof Fixed fixed && s.equals(fixed.string));
|
||||||
return this;
|
return this;
|
||||||
|
@ -82,6 +90,21 @@ public class CommandBuilder {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CommandBuilder addQuoted(int index, String s) {
|
||||||
|
elements.add(index, sc -> {
|
||||||
|
if (s == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sc == null) {
|
||||||
|
return "\"" + s + "\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
return sc.getShellDialect().quoteArgument(s);
|
||||||
|
});
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public CommandBuilder addSub(CommandBuilder sub) {
|
public CommandBuilder addSub(CommandBuilder sub) {
|
||||||
elements.add(sc -> {
|
elements.add(sc -> {
|
||||||
if (sc == null) {
|
if (sc == null) {
|
||||||
|
|
Loading…
Reference in a new issue