#!/usr/bin/env python3
"""Install the capture driver into a disposable T3 checkout; no commits are made."""
from pathlib import Path
import shutil
import sys
checkout = Path(sys.argv[1]).resolve()
source = Path(__file__).resolve().parent
shutil.copyfile(source / 'missing-terminal-folder.e2e.ts', checkout / 'scripts/scenarios/missing-terminal-folder.e2e.ts')
config = checkout / 'scripts/e2e.config.ts'
text = config.read_text().replace('width: 1280, height: 800', 'width: 1600, height: 900')
text = text.replace('  ],\n  // One server', '  ].filter((target) => target.name === "web"),\n  // One server')
config.write_text(text)
print('Driver installed. Run vp i, then from scripts/: bash /path/to/run-evidence.sh /path/to/app-checkout base')
