Skip to content

Commit ff0de1c

Browse files
committed
Hopefully final pass at datapackage cache
1 parent 5848ae8 commit ff0de1c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/main/java/dev/koifysh/archipelago/Client.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,28 @@ public abstract class Client {
4242
String appData = System.getenv("LOCALAPPDATA");
4343
String winHome = System.getenv("USERPROFILE");
4444
String userHome = System.getProperty("user.home");
45+
String xdg = System.getenv("XDG_CACHE_HOME");
4546

4647
if(OS.startsWith("windows"))
4748
{
4849
if(appData == null || appData.isEmpty()) {
49-
cachePath = Paths.get(winHome, "appdata", "local", "Archipelago", "Cache");
50+
cachePath = Paths.get(winHome, "AppData", "Local", "Archipelago", "Cache");
5051
} else {
5152
cachePath = Paths.get(appData, "Archipelago", "Cache");
5253
}
5354
}
54-
else
55+
else if(OS.startsWith("Mac") || OS.startsWith("Darwin"))
56+
{
57+
cachePath = Paths.get(userHome, "Library", "Caches", "Archipelago");
58+
}
59+
else if(xdg == null || xdg.isEmpty() )
5560
{
5661
cachePath = Paths.get(userHome, ".cache", "Archipelago");
5762
}
63+
else
64+
{
65+
cachePath = Paths.get(xdg, "Archipelago");
66+
}
5867
datapackageCachePath = cachePath.resolve("datapackage");
5968

6069
}

0 commit comments

Comments
 (0)