[FEATURE] Default value client and assets download

This commit is contained in:
microwin7 2023-03-08 04:47:26 +03:00 committed by GitHub
parent 57868a7136
commit bce28b7c38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,10 +38,16 @@ public String getUsageDescription() {
@Override
public void invoke(String... args) throws IOException, CommandException {
verifyArgs(args, 2);
//Version version = Version.byName(args[0]);
verifyArgs(args, 1);
String versionName = args[0];
String dirName = IOHelper.verifyFileName(args[1] != null ? args[1] : args[0]);
String dirName;
try {
dirName = IOHelper.verifyFileName(args[1]);
} catch (ArrayIndexOutOfBoundsException e) {
dirName = IOHelper.verifyFileName(args[0]);
logger.warn("There is no specified profile name, the default value is set as the name of the downloaded client archive: " + dirName);
}
Path clientDir = server.updatesDir.resolve(dirName);
boolean isMirrorClientDownload = false;