web/control-panel-inventory/install-assets.py
unimatrixgit 9dcd9b084a Integrate shared planetary inventories and account sales with the current site
Merge the supplied inventory/exchange package into the latest DuneRealms source.
Keep community-reward receipts, verified UUID linking, native menus and current
website artwork, Dutch naming and account controls. Wire the inventory/sales
adapters into the real CP session and verified-link schema, with isolated reads
and honest unconfigured states. Preserve lobby/ender separation and Core-owned
atomic exchange checkpoints.

Validation: website build and 56 tests; 12 inventory/market adapter tests;
Core/Essentials and NPC/Terrain/Lobby builds and tests; local browser inspection
of the themed inventory, mannequin and History of sales with fictional fixtures.
Paper 1.21.8 source only: live 1.21.4 binaries and databases are unchanged.
2026-10-27 19:44:22 +01:00

18 lines
1.2 KiB
Python

#!/usr/bin/env python3
"""Install account-page assets into an existing CP source checkout; does not deploy or change auth."""
import argparse, shutil
from pathlib import Path
parser=argparse.ArgumentParser()
parser.add_argument('public_directory',type=Path)
a=parser.parse_args();target=a.public_directory.resolve();index=target/'index.html'
if not index.is_file():parser.error('The supplied directory must contain the existing control panel index.html')
html=index.read_text()
if 'id="dashboard"' not in html or 'id="game"' not in html:parser.error('Expected existing account dashboard and game-link sections were not found')
if not index.with_suffix('.html.before-inventory').exists():shutil.copy2(index,index.with_suffix('.html.before-inventory'))
shutil.copytree(Path(__file__).resolve().parents[1]/'website'/'control-panel'/'public'/'inventory',target/'inventory',dirs_exist_ok=True)
css='<link rel="stylesheet" href="/inventory/inventory.css">'
js='<script type="module" src="/inventory/inventory-mount.mjs"></script>'
if css not in html:html=html.replace('</head>',css+'</head>',1)
if js not in html:html=html.replace('</body>',js+'</body>',1)
index.write_text(html)
print('Account assets installed. Wire the authenticated server routes before deploying this checkout.')