Simplify ScriptExecutor
Dieser Commit ist enthalten in:
Ursprung
5e5881cf4c
Commit
1c91105367
@ -68,7 +68,7 @@ public final class ScriptExecutor {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] strings = generateStringArray(command);
|
String[] strings = replaceVariables(command);
|
||||||
if (strings.length == 0) {
|
if (strings.length == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -99,12 +99,8 @@ public final class ScriptExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[] generateStringArray(String command) {
|
private String[] replaceVariables(String s) {
|
||||||
return replaceVariables(command.replaceAll(" +", " ").split(" "));
|
s = s.replaceAll(" +", " ");
|
||||||
}
|
|
||||||
|
|
||||||
private String[] replaceVariables(String[] args) {
|
|
||||||
String s = String.join(" ", args);
|
|
||||||
Set<String> variables = new HashSet<>(localVariables.allVariables());
|
Set<String> variables = new HashSet<>(localVariables.allVariables());
|
||||||
variables.addAll(Constants.allVariables());
|
variables.addAll(Constants.allVariables());
|
||||||
variables.addAll(globalVariables.allVariables());
|
variables.addAll(globalVariables.allVariables());
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren