#!/usr/bin/env python3 """Keep complete native diagnostics and exact fixture/source provenance.""" from pathlib import Path import json,shutil,sys name=sys.argv[1] if not name.isalnum(): raise ValueError('Use an alphanumeric run suffix') source=Path('/tmp/erri-rescue-landing-source-'+name) profile=Path('/tmp/erri-rescue-landing-run-'+name) target=Path(__file__).with_name('run-'+name) target.mkdir() for filename in ['runner-output.log','fixture-inputs.json']: if (profile/filename).exists(): shutil.copy2(profile/filename,target/filename) fixture=source/'addons/core/Scripts/Game/ERR/00_Core/ERR_ZRescueFactionFixture.c' if fixture.exists(): shutil.copy2(fixture,target/'native-fixture.c') sessions=sorted((profile/'logs').glob('logs_*')) if sessions: for path in sessions[-1].iterdir(): if path.is_file() and path.suffix in {'.log','.json'}: shutil.copy2(path,target/path.name) print(target)