mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-08-15 19:17:31 +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.nio.file.Path;
|
||||||
import java.security.Security;
|
import java.security.Security;
|
||||||
import java.security.cert.CertificateException;
|
import java.security.cert.CertificateException;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class LaunchServerStarter {
|
public class LaunchServerStarter {
|
||||||
|
@ -122,19 +123,19 @@ public static void main(String[] args) throws Exception {
|
||||||
List<String> allArgs = List.of(args);
|
List<String> allArgs = List.of(args);
|
||||||
boolean isPrepareMode = prepareMode || allArgs.contains("--prepare");
|
boolean isPrepareMode = prepareMode || allArgs.contains("--prepare");
|
||||||
boolean isRunCommand = false;
|
boolean isRunCommand = false;
|
||||||
String runCommand = null;
|
List<String> runCommand = new ArrayList<>();
|
||||||
for(var e : allArgs) {
|
for(var e : allArgs) {
|
||||||
if(e.equals("--run")) {
|
if(e.equals("--run")) {
|
||||||
isRunCommand = true;
|
isRunCommand = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(isRunCommand) {
|
if(isRunCommand) {
|
||||||
runCommand = e;
|
runCommand.add(e);
|
||||||
isRunCommand = false;
|
isRunCommand = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(runCommand != null) {
|
for(var cmd : runCommand) {
|
||||||
localCommandHandler.eval(runCommand, false);
|
localCommandHandler.eval(cmd, false);
|
||||||
}
|
}
|
||||||
if (!isPrepareMode) {
|
if (!isPrepareMode) {
|
||||||
server.run();
|
server.run();
|
||||||
|
|
Loading…
Reference in a new issue