Refactor language pack scripts: replace shell scripts with Python equivalents for improved maintainability and functionality; remove obsolete scripts and update surfer.json formatting.

This commit is contained in:
mr. M 2025-01-13 23:15:37 +01:00
parent 2aaf3f82e6
commit a512948eb0
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB
8 changed files with 93 additions and 26 deletions

View file

@ -7,6 +7,7 @@ from typing import Optional
METADATA_FILENAME = "surfer.json"
TAGS_API_URL = "https://hg.mozilla.org/releases/mozilla-release/json-tags"
def get_current_version() -> Optional[str]:
"""Retrieve the current version from the metadata file."""
try:
@ -17,6 +18,7 @@ def get_current_version() -> Optional[str]:
print(f"Error reading current version: {e}")
return None
def get_repo_data() -> Optional[str]:
"""Retrieve the repository data from the API."""
try:
@ -28,6 +30,7 @@ def get_repo_data() -> Optional[str]:
print(f"Error retrieving repository data: {e}")
return None
def get_rc_response() -> Optional[str]:
"""Get the release candidate response from the response file."""
try:
@ -68,9 +71,11 @@ def send_webhook(rc: str) -> None:
else:
print("Webhook URL not set.")
def rc_should_be_updated(rc_response: str, current_version: str) -> bool:
return rc_response and rc_response != current_version
def main() -> int:
current_version = get_current_version()
rc_response = get_rc_response()