From 231ee4b339058c0232e8f5a72f100baf3926b48e Mon Sep 17 00:00:00 2001 From: RaphiMC <50594595+RaphiMC@users.noreply.github.com> Date: Fri, 5 Jul 2024 20:40:11 +0200 Subject: [PATCH] Added environment variable to set the CWD --- src/main/java/net/raphimc/viaproxy/ViaProxy.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/net/raphimc/viaproxy/ViaProxy.java b/src/main/java/net/raphimc/viaproxy/ViaProxy.java index 60394d1..f45b031 100644 --- a/src/main/java/net/raphimc/viaproxy/ViaProxy.java +++ b/src/main/java/net/raphimc/viaproxy/ViaProxy.java @@ -117,6 +117,9 @@ public class ViaProxy { final boolean useCLI = args.length > 0 && args[0].equals("cli"); final List 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);