i forgor the **VERY IMPORTANT** part

This commit is contained in:
Chayapak 2023-03-31 15:01:31 +07:00
parent 2d3f61b987
commit 3c1d06182c

View file

@ -10,6 +10,7 @@ import net.kyori.adventure.text.format.NamedTextColor;
import java.io.*; import java.io.*;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Arrays; import java.util.Arrays;
import java.util.Comparator;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.zip.GZIPInputStream; import java.util.zip.GZIPInputStream;
@ -71,6 +72,8 @@ public class GrepLogPlugin {
final File[] fileList = Logger.logDir.listFiles(); final File[] fileList = Logger.logDir.listFiles();
Arrays.sort(fileList, Comparator.comparing(File::getName)); // VERY IMPORTANT
for (File file : fileList) { for (File file : fileList) {
final String fileName = file.getName(); final String fileName = file.getName();
if (fileName.matches(".*\\.txt\\.gz")) { if (fileName.matches(".*\\.txt\\.gz")) {