#!/usr/bin/env python3
from pathlib import Path
# cockpit main.py - add retail router
main = Path("/home/aissa/foodlinkk-command-center/cockpit/app/main.py")
text = main.read_text()
if "retail" not in text:
text = text.replace(
" browser,\n hermes,\n)",
" browser,\n hermes,\n retail,\n)",
)
text = text.replace(
"from app.routes import (",
"from app.routes import (\n retail,",
)
if "retail.router," not in text:
text = text.replace(
" marketing.router,\n",
" marketing.router,\n retail.router,\n",
)
main.write_text(text)
# base.html - add Retail link under Intel
base = Path("/home/aissa/foodlinkk-command-center/cockpit/templates/base.html")
b = base.read_text()
if "/retail" not in b:
b = b.replace(
'Retail\n Analytics',
'\n ',
)
mt += '''