Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Fix libraries issues on updates
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldieeins committed Jun 16, 2024
1 parent c9efc0f commit d25d775
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public static boolean update(ReadableInstance localInstance) {
String path = Application.getInstancePath() + "instances/" + onlineInstance.getId() + "/";
File pack = new File(path + "meta/pack.zip");
File mods = new File(path + "/mods/");
File libraries = new File(path + "/libraries/");
Main.getLogger().log("[ZYNDEX] Checking if old pack file exists...");
if (pack.exists()) {
Main.getLogger().log("[ZYNDEX] Found old pack file!");
Expand All @@ -98,6 +99,13 @@ public static boolean update(ReadableInstance localInstance) {
Main.getLogger().log("[ZYNDEX] Downloading new pack file...");
pack = FileUtil.downloadFile(onlineInstance.getDownloadUrl(), path + "meta/pack.zip");
Main.getLogger().log("[ZYNDEX] New pack file downloaded!");

Main.getLogger().log("[ZYNDEX] Deleting old libraries...");
if (!libraries.mkdirs()) {
FileUtil.deleteFolder(libraries);
}
Main.getLogger().log("[ZYNDEX] Old libraries deleted!");

Main.getLogger().log("[ZYNDEX] Deleting old mods...");
if (!mods.mkdirs()) {
FileUtil.deleteFolder(mods);
Expand Down

0 comments on commit d25d775

Please sign in to comment.