@@ -25,6 +25,13 @@ def clone_repo_to(dest: Path):
2525 os .symlink (REPO_ROOT / "target" , dest / "target" )
2626
2727
28+ def apply_patches_for_release (release : str , repo_path : Path ) -> None :
29+ """Apply patches (if any) for the given release."""
30+ patches_dir = DOCS_DIR / "release" / "patches" / release
31+ for patch_path in sorted (patches_dir .glob ("*.patch" )):
32+ sp .run (("git" , "-C" , str (repo_path ), "am" , str (patch_path )), check = True )
33+
34+
2835def build_docs_for_release (release : str , repo_path : Path , outdir : Path ) -> None :
2936 """Build documentation for a given release."""
3037 print (f"Building docs for { release } " )
@@ -36,10 +43,8 @@ def build_docs_for_release(release: str, repo_path: Path, outdir: Path) -> None:
3643 capture_output = True ,
3744 )
3845
39- # Apply patch, if there is one
40- patch_path = DOCS_DIR / "release" / "patches" / f"{ release } .patch"
41- if patch_path .exists ():
42- sp .run (("git" , "-C" , str (repo_path ), "am" , str (patch_path )), check = True )
46+ # Apply patches, if any
47+ apply_patches_for_release (release , repo_path )
4348
4449 # Build docs
4550 sp .run (("just" , f"{ repo_path !s} /build-docs" ), capture_output = True , check = True )
0 commit comments