#!/bin/sh
ROOT=/opt/struktur/hermes-ui-auswahl/hermes-workspace/src
python3 - <<'PY'
from pathlib import Path
files = [
Path('/opt/struktur/hermes-ui-auswahl/hermes-workspace/src/components/terminal/terminal-workspace.tsx'),
Path('/opt/struktur/hermes-ui-auswahl/hermes-workspace/src/components/terminal/terminal-panel.tsx'),
Path('/opt/struktur/hermes-ui-auswahl/hermes-workspace/src/components/swarm/swarm-terminal.tsx'),
]
for p in files:
s = p.read_text()
old = "headers: { 'Content-Type': 'application/json' },"
new = "headers: { 'Content-Type': 'application/json' },\n credentials: 'same-origin',"
count = s.count(old)
if count == 0:
raise SystemExit(f'no target in {p}')
p.write_text(s.replace(old, new))
print(p, count)
PY