Skip to content

Commit

Permalink
[scripts] Use correct java for neoforge smoke tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEpicBlock committed Sep 30, 2024
1 parent 632170c commit f8b2741
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,18 @@ def run_server(exec_dir, java, loader, java_args, mc_args, **kwargs) -> subproce
return subprocess.run([java] + java_args + ["-jar", exec_dir / "fabric-server-launch.jar"] + mc_args, **kwargs)
elif loader == "neoforge":
env = {}
# Pass the jdk options as an env variable
if len(java_args) > 0:
env["JDK_JAVA_OPTIONS"] = " ".join(java_args)

# Set env to use the right java
path = os.env["PATH"] if "PATH" in os.env else ""
if os.name == "nt":
env["PATH"] = f"{java.parent};{path}"
else:
env["PATH"] = f"{java.parent}:{path}"

# Run the bash file
bash_file = "run.bat" if os.name == "nt" else "run.sh"
return subprocess.run([exec_dir / bash_file] + mc_args, env=env, **kwargs)
else:
Expand Down

0 comments on commit f8b2741

Please sign in to comment.