a995fd3b46
The launcher prepares a version in-process when it ships the preparer sources the launcher was built with, with the version's own horizon-prepare when they differ, and with the Python script only for versions made before it. Release folders ship horizon-prepare and its sources; resources are reused between versions with the same preparer. The game's messages, PLAY.txt, the docs and release builds name horizon-prepare, and tools/prepare_native_client.py is a wrapper of it for the development tools. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
1002 B
Python
29 lines
1002 B
Python
#!/usr/bin/env python3
|
|
"""Prepare private pinned resources for Horizon's native development client.
|
|
|
|
The preparation itself is horizon-prepare (crates/horizon-prepare), the Rust port of what this
|
|
script did; this wrapper keeps its command line for the development tools that call it. It runs
|
|
the horizon-prepare beside this folder (a release folder), else builds it with cargo. Arguments
|
|
are passed through: --prepare, --server-jar PATH, --minecraft-dir PATH.
|
|
"""
|
|
import os
|
|
from pathlib import Path
|
|
import subprocess
|
|
import sys
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
def main():
|
|
arguments = ['--root', str(ROOT), *sys.argv[1:]]
|
|
beside = ROOT / ('horizon-prepare.exe' if os.name == 'nt' else 'horizon-prepare')
|
|
if beside.is_file():
|
|
command = [str(beside), *arguments]
|
|
else:
|
|
command = ['cargo', 'run', '--quiet', '--release', '-p', 'horizon-prepare', '--', *arguments]
|
|
return subprocess.call(command, cwd=ROOT)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
sys.exit(main())
|