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