2025-07-29 20:38:12 +02:00

21 lines
587 B
Python
Executable File

#!.venv/bin/python3
import requests
from pathlib import Path
import json
CARGO_MOMMY_DATA = "https://raw.githubusercontent.com/Gankra/cargo-mommy/refs/heads/main/responses.json"
MODULE_PATH = Path("python_mommy_venv")
if __name__ == "__main__":
print("generating stuff")
res = requests.get(CARGO_MOMMY_DATA)
if not res.ok:
raise Exception(f"couldn't fetch {CARGO_MOMMY_DATA} ({res.status_code})")
print(f"writing {Path(MODULE_PATH, 'responses.json')}")
with Path(MODULE_PATH, "responses.json").open("w") as f:
json.dump(res.json(), f, indent=4)