Pipeline: parse HTML presets, compare modlists, download from Caddy file server, create junctions/symlinks to Arma 3 Server directory. Includes update/sync flows, missing-mod reporting, OS compat layer, shared config, dep checker, comprehensive test suite (71 tests). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
773 B
Python
27 lines
773 B
Python
#!/usr/bin/env python3
|
|
"""CLI entry point: parse all mod preset HTMLs in modlist_html/ -> modlist_json/."""
|
|
|
|
import json
|
|
|
|
from arma_modlist_tools import parse_modlist_dir
|
|
from arma_modlist_tools.config import load_config
|
|
|
|
|
|
def main():
|
|
cfg = load_config()
|
|
cfg.modlist_json.mkdir(exist_ok=True)
|
|
|
|
presets = parse_modlist_dir(cfg.modlist_html)
|
|
if not presets:
|
|
print(f"No .html files found in {cfg.modlist_html}/")
|
|
return
|
|
|
|
for preset in presets:
|
|
out_file = cfg.modlist_json / (preset["preset_name"] + ".json")
|
|
out_file.write_text(json.dumps(preset, indent=2, ensure_ascii=False), encoding="utf-8")
|
|
print(f"{preset['source_file']} -> {out_file} ({preset['mod_count']} mods)")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|