blob: 01ecf63e519a8c1f8f343092c0c3ba8f5a2a9a40 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import re
import sys
from pathlib import Path
# Read 'release' variable from BedrockConnect.java to use for new version
file_path = Path("serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/BedrockConnect.java")
try:
content = file_path.read_text()
except FileNotFoundError:
sys.stderr.write(f"File not found: {file_path}\n")
sys.exit(1)
ver_string = re.search(r'String\s+release\s*=\s*"([^"]+)"', content)
if ver_string:
print(ver_string.group(1))
else:
sys.stderr.write("No release version found in file.\n")
sys.exit(1)
|