mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Add default data dir property
This commit is contained in:
parent
ce5c06c124
commit
7390d3b25c
1 changed files with 3 additions and 1 deletions
|
@ -37,6 +37,7 @@ public class AppProperties {
|
|||
boolean useVirtualThreads;
|
||||
boolean debugThreads;
|
||||
Path dataDir;
|
||||
Path defaultDataDir;
|
||||
boolean showcase;
|
||||
AppVersion canonicalVersion;
|
||||
boolean locatePtb;
|
||||
|
@ -87,6 +88,7 @@ public class AppProperties {
|
|||
debugThreads = Optional.ofNullable(System.getProperty("io.xpipe.app.debugThreads"))
|
||||
.map(Boolean::parseBoolean)
|
||||
.orElse(false);
|
||||
defaultDataDir = Path.of(System.getProperty("user.home"), isStaging() ? ".xpipe-ptb" : ".xpipe");
|
||||
dataDir = Optional.ofNullable(System.getProperty("io.xpipe.app.dataDir"))
|
||||
.map(s -> {
|
||||
var p = Path.of(s);
|
||||
|
@ -95,7 +97,7 @@ public class AppProperties {
|
|||
}
|
||||
return p;
|
||||
})
|
||||
.orElse(Path.of(System.getProperty("user.home"), isStaging() ? ".xpipe-ptb" : ".xpipe"));
|
||||
.orElse(defaultDataDir);
|
||||
showcase = Optional.ofNullable(System.getProperty("io.xpipe.app.showcase"))
|
||||
.map(Boolean::parseBoolean)
|
||||
.orElse(false);
|
||||
|
|
Loading…
Reference in a new issue