From 7390d3b25ca9495b31b56838c58c7cb7aa5fcdd8 Mon Sep 17 00:00:00 2001 From: crschnick Date: Fri, 2 Aug 2024 17:33:05 +0000 Subject: [PATCH] Add default data dir property --- app/src/main/java/io/xpipe/app/core/AppProperties.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/xpipe/app/core/AppProperties.java b/app/src/main/java/io/xpipe/app/core/AppProperties.java index f661ea143..0a18c8d45 100644 --- a/app/src/main/java/io/xpipe/app/core/AppProperties.java +++ b/app/src/main/java/io/xpipe/app/core/AppProperties.java @@ -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);