"""Copies the initial submission (output/site, output/handoff.md, output/checks) into output/original_submission_v1/ before any revision. Refuses to overwrite an existing copy.""" import os, shutil out = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..') dst = os.path.join(out, 'original_submission_v1') if os.path.exists(dst): raise SystemExit('copy already exists; not overwriting') os.makedirs(dst) shutil.copytree(os.path.join(out, 'site'), os.path.join(dst, 'site')) shutil.copy(os.path.join(out, 'handoff.md'), dst) shutil.copytree(os.path.join(out, 'checks'), os.path.join(dst, 'checks'), ignore=shutil.ignore_patterns('preserve_v1.py', '__pycache__')) for root, _, files in os.walk(dst): for f in files: print(os.path.relpath(os.path.join(root, f), out))