From c0f02e2813578454a4cb4e19c185a73123ef4cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Voln=C3=BD?= Date: Wed, 8 Apr 2020 13:35:43 +0200 Subject: [PATCH] Permit double .txt.txt extension for config file - this might make life easier for some of the streamers --- src/main/java/str_exporter/SlayTheRelicsExporter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/str_exporter/SlayTheRelicsExporter.java b/src/main/java/str_exporter/SlayTheRelicsExporter.java index 36dc80e..4919acb 100644 --- a/src/main/java/str_exporter/SlayTheRelicsExporter.java +++ b/src/main/java/str_exporter/SlayTheRelicsExporter.java @@ -27,6 +27,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Iterator; @@ -103,7 +104,11 @@ public static void initialize() version = getVersion(); try { - String data = new String(Files.readAllBytes(Paths.get("slaytherelics_config.txt"))); + Path path = Paths.get("slaytherelics_config.txt"); + if (!Files.exists(path)) + path = Paths.get("slaytherelics_config.txt.txt"); + + String data = new String(Files.readAllBytes(path)); String[] lines = data.split("\r\n");