allow to set the socket dir via SLIMEVR_SOCKET_DIR (#909)

This commit is contained in:
Markus authored and GitHub committed 2024-02-15 21:33:55 -03:00
1 parent 1dd1d14d16
commit 7f75f4a44c
2 files changed
+7 -5

No files matched your search

@@ -32,11 +32,13 @@ enum class OperatingSystem(
}
}
val tempDirectory: String
val socketDirectory: String
get() {
var dir = System.getenv("SLIMEVR_SOCKET_DIR")
if (dir != null) return dir
if (currentPlatform == LINUX) {
val tmp = System.getenv("XDG_RUNTIME_DIR")
if (tmp != null) return tmp
dir = System.getenv("XDG_RUNTIME_DIR")
if (dir != null) return dir
}
return System.getProperty("java.io.tmpdir")
}