diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/GrepLogPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/GrepLogPlugin.java index 951b3d9..8287e76 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/GrepLogPlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/GrepLogPlugin.java @@ -10,6 +10,7 @@ import net.kyori.adventure.text.format.NamedTextColor; import java.io.*; import java.nio.charset.StandardCharsets; import java.util.Arrays; +import java.util.Comparator; import java.util.regex.Pattern; import java.util.zip.GZIPInputStream; @@ -71,6 +72,8 @@ public class GrepLogPlugin { final File[] fileList = Logger.logDir.listFiles(); + Arrays.sort(fileList, Comparator.comparing(File::getName)); // VERY IMPORTANT + for (File file : fileList) { final String fileName = file.getName(); if (fileName.matches(".*\\.txt\\.gz")) {