Files

12 lines
439 B
Python
Raw Permalink Normal View History

#!/usr/bin/env python3
from pathlib import Path
p = Path("/home/aissa/foodlinkk-command-center/cockpit/app/routes/admin_api.py")
text = p.read_text()
if "reco_proxy" not in text:
text = "from app.routes.reco_proxy import register_recommendation_routes\n" + text
if "register_recommendation_routes(admin_router)" not in text:
text += "\nregister_recommendation_routes(admin_router)\n"
p.write_text(text)
print("admin_api patched")