#!/usr/bin/env python3
"""Copies the shared employer storyboard (desk.js) into both demos between the @DESK markers."""
import os,re
H=os.path.dirname(os.path.abspath(__file__));D=open(os.path.join(H,"desk.js"),encoding="utf-8").read().strip()
for p in ("../../surch-candidate/src/showcase.js","../../surch-site/src/herodemo.js"):
    f=os.path.normpath(os.path.join(H,p));s=open(f,encoding="utf-8").read()
    n=re.sub(r"/\*@DESK-START.*?/\*@DESK-END\*/",lambda m:D,s,flags=re.S)
    if n!=s:open(f,"w",encoding="utf-8").write(n)
