mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-08-15 02:57:27 +03:00
[FEATURE] Support multiple --run command arguments
This commit is contained in:
parent
2375bb5aa3
commit
6ead3c336e
1 changed files with 5 additions and 4 deletions
|
@ -34,6 +34,7 @@
|
|||
import java.nio.file.Path;
|
||||
import java.security.Security;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LaunchServerStarter {
|
||||
|
@ -122,19 +123,19 @@ public static void main(String[] args) throws Exception {
|
|||
List<String> allArgs = List.of(args);
|
||||
boolean isPrepareMode = prepareMode || allArgs.contains("--prepare");
|
||||
boolean isRunCommand = false;
|
||||
String runCommand = null;
|
||||
List<String> runCommand = new ArrayList<>();
|
||||
for(var e : allArgs) {
|
||||
if(e.equals("--run")) {
|
||||
isRunCommand = true;
|
||||
continue;
|
||||
}
|
||||
if(isRunCommand) {
|
||||
runCommand = e;
|
||||
runCommand.add(e);
|
||||
isRunCommand = false;
|
||||
}
|
||||
}
|
||||
if(runCommand != null) {
|
||||
localCommandHandler.eval(runCommand, false);
|
||||
for(var cmd : runCommand) {
|
||||
localCommandHandler.eval(cmd, false);
|
||||
}
|
||||
if (!isPrepareMode) {
|
||||
server.run();
|
||||
|
|
Loading…
Reference in a new issue