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/";
|
basePath = "Library/Application Support/Shattered Pixel Dungeon/";
|
||||||
} else if (SharedLibraryLoader.isLinux) {
|
} else if (SharedLibraryLoader.isLinux) {
|
||||||
String XDGHome = System.getenv().get("XDG_DATA_HOME");
|
String XDGHome = System.getenv().get("XDG_DATA_HOME");
|
||||||
if (XDGHome == null) XDGHome = ".local/share/";
|
if (XDGHome == null) XDGHome = ".local/share";
|
||||||
basePath = XDGHome + ".shatteredpixel/shattered-pixel-dungeon/";
|
basePath = XDGHome + "/.shatteredpixel/shattered-pixel-dungeon/";
|
||||||
|
|
||||||
//copy over files from old linux save DIR, pre-1.2.0
|
//copy over files from old linux save DIR, pre-1.2.0
|
||||||
FileHandle oldBase = new Lwjgl3FileHandle(".shatteredpixel/shattered-pixel-dungeon/", Files.FileType.External);
|
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 (oldBase.exists()){
|
||||||
if (!newBase.exists()) {
|
if (!newBase.exists()) {
|
||||||
oldBase.copyTo(newBase.parent());
|
oldBase.copyTo(newBase.parent());
|
||||||
|
|||||||
Reference in New Issue
Block a user