from pathlib import Path
import subprocess
home = Path.home()
repo = home / 'demo-repo'
repo.mkdir(exist_ok=False)
(repo / 'docs').mkdir()
(repo / 'README.md').write_text('# Project readme\n\nRelative link reached the correct file.\n')
(repo / 'docs/guide.md').write_text('# Guide\n\n[Home notes](~/notes.md)\n\n[Readme](../README.md)\n')
with (home / 'notes.md').open('x') as f:
    f.write('# Home notes\n\nHome link reached the correct file.\n')
subprocess.run(['git','init','--quiet',str(repo)],check=True)
subprocess.run(['git','-C',str(repo),'add','.'],check=True)
subprocess.run(['git','-C',str(repo),'-c','user.name=Proof','-c','user.email=proof@example.invalid','commit','-qm','Seed demo files'],check=True)
