Allow specifying base path as system property

This commit is contained in:
Johannes Frohnmeyer 2021-12-27 16:18:05 +01:00
parent 8c0019912f
commit c3de25b125
Signed by: Johannes
GPG Key ID: E76429612C2929F4
1 changed files with 9 additions and 4 deletions

View File

@ -25,10 +25,15 @@ public class MetaHolder {
.registerTypeAdapter(ComparableVersion.class, new ComparableVersionAdapter())
.create()
.fromJson(isr, InceptumVersion.class);
Path runDir = getRunDir();
BASE_PATH = VERSION.isRelease && !Files.exists(runDir)
? getConfigPath().resolve("Inceptum")
: runDir;
if (System.getProperty("inceptum.base") == null) {
Path runDir = getRunDir();
BASE_PATH = VERSION.isRelease && !Files.exists(runDir)
? getConfigPath().resolve("Inceptum")
: runDir;
}
else {
BASE_PATH = Path.of(System.getProperty("inceptum.base"));
}
} catch (IOException e) {
throw new RuntimeException("Could not get version info", e);
}