Files
libretro/scripts/list_platforms.py
T
Abdessamad Derraz 4d3f589ef4 refactor: drop the archived platform status
RetroPie was the only platform with status: archived, which kept it out
of verify --all, slots, the pipeline and list_platforms unless
--include-archived was typed. release_pack already decides which packs a
release publishes and the installer serves every platform, so the status
set nothing apart. The field, its schema entry and the flag are gone, and
RetroPie is covered by every full run like any other platform.
2026-11-06 11:52:34 +01:00

49 lines
1.1 KiB
Python

#!/usr/bin/env python3
"""List the platforms registered in _registry.yml.
Usage:
python scripts/list_platforms.py
python scripts/list_platforms.py >> "$GITHUB_OUTPUT"
"""
from __future__ import annotations
import argparse
import json
import os
import sys
sys.path.insert(0, os.path.dirname(__file__))
from common import list_registered_platforms
PLATFORMS_DIR = "platforms"
def list_platforms() -> list[str]:
"""Every registered platform."""
return list_registered_platforms(PLATFORMS_DIR)
def main() -> None:
parser = argparse.ArgumentParser(allow_abbrev=False, description="List available platforms")
parser.parse_args()
platforms = list_platforms()
if not platforms:
print("No platform configs found", file=sys.stderr)
sys.exit(1)
github_output = os.environ.get("GITHUB_OUTPUT")
if github_output:
with open(github_output, "a") as f:
f.write(f"platforms={json.dumps(platforms)}\n")
else:
print(json.dumps(platforms))
if __name__ == "__main__":
from common import run_cli
run_cli(main)