[FEATURE] SyncUPCommand (#396)

* Create SyncAll.java

Выплёвываю как есть. Регистрация где - я хз. Дальше сами.

* Update CommandHandler.java

* Update and rename SyncAll.java to SyncUP.java

* Update CommandHandler.java

* Update and rename SyncUP.java to SyncUPCommand.java

* Update CommandHandler.java
This commit is contained in:
Will0376 2020-06-17 11:46:08 +03:00 committed by GitHub
parent 09a6afdf57
commit 3e6384cad9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 0 deletions

View file

@ -48,6 +48,7 @@ public static void registerCommands(pro.gravit.utils.command.CommandHandler hand
updates.registerCommand("syncBinaries", new SyncBinariesCommand(server));
updates.registerCommand("syncUpdates", new SyncUpdatesCommand(server));
updates.registerCommand("syncProfiles", new SyncProfilesCommand(server));
updates.registerCommand("syncUP", new SyncUPCommand(server));
updates.registerCommand("saveProfiles", new SaveProfilesCommand(server));
Category updatesCategory = new Category(updates, "updates", "Update and Sync Management");
handler.registerCategory(updatesCategory);

View file

@ -0,0 +1,32 @@
package pro.gravit.launchserver.command.hash;
import pro.gravit.launchserver.LaunchServer;
import pro.gravit.launchserver.command.Command;
import pro.gravit.utils.helper.LogHelper;
import java.io.IOException;
public final class SyncUPCommand extends Command {
public SyncUPCommand(LaunchServer server) {
super(server);
}
@Override
public String getArgsDescription() {
return null;
}
@Override
public String getUsageDescription() {
return "Resync profiles & updates dirs";
}
@Override
public void invoke(String... args) throws IOException {
server.syncProfilesDir();
LogHelper.subInfo("Profiles successfully resynced");
server.syncUpdatesDir(null);
LogHelper.subInfo("Updates dir successfully resynced");
}
}