Skip to content

Commit

Permalink
Permit double .txt.txt extension for config file
Browse files Browse the repository at this point in the history
 - this might make life easier for some of the streamers
  • Loading branch information
avolny committed Apr 8, 2020
1 parent 777d21b commit c0f02e2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/str_exporter/SlayTheRelicsExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");

Expand Down

0 comments on commit c0f02e2

Please sign in to comment.