v1.3.0: fixed desktop backend assuming XDG_DATA_HOME contained a slash
This commit is contained in:
@@ -143,12 +143,12 @@ public class DesktopLauncher {
|
||||
basePath = "Library/Application Support/Shattered Pixel Dungeon/";
|
||||
} else if (SharedLibraryLoader.isLinux) {
|
||||
String XDGHome = System.getenv().get("XDG_DATA_HOME");
|
||||
if (XDGHome == null) XDGHome = ".local/share/";
|
||||
basePath = XDGHome + ".shatteredpixel/shattered-pixel-dungeon/";
|
||||
if (XDGHome == null) XDGHome = ".local/share";
|
||||
basePath = XDGHome + "/.shatteredpixel/shattered-pixel-dungeon/";
|
||||
|
||||
//copy over files from old linux save DIR, pre-1.2.0
|
||||
FileHandle oldBase = new Lwjgl3FileHandle(".shatteredpixel/shattered-pixel-dungeon/", Files.FileType.External);
|
||||
FileHandle newBase = new Lwjgl3FileHandle(XDGHome + ".shatteredpixel/shattered-pixel-dungeon/", Files.FileType.External);
|
||||
FileHandle newBase = new Lwjgl3FileHandle(basePath, Files.FileType.External);
|
||||
if (oldBase.exists()){
|
||||
if (!newBase.exists()) {
|
||||
oldBase.copyTo(newBase.parent());
|
||||
|
||||
Reference in New Issue
Block a user