Added environment variable to set the CWD

This commit is contained in:
RaphiMC 2024-07-05 20:40:11 +02:00
parent 5a0305a09b
commit 231ee4b339
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94

View File

@ -117,6 +117,9 @@ public class ViaProxy {
final boolean useCLI = args.length > 0 && args[0].equals("cli");
final List<File> potentialCwds = new ArrayList<>();
if (System.getenv("VP_RUN_DIR") != null) {
potentialCwds.add(new File(System.getenv("VP_RUN_DIR")));
}
potentialCwds.add(new File(System.getProperty("user.dir")));
potentialCwds.add(new File("."));
JarUtil.getJarFile().map(File::getParentFile).ifPresent(potentialCwds::add);