Skip to content

Commit

Permalink
Merge pull request #2830 from steffengraber/test-patch
Browse files Browse the repository at this point in the history
Enable patching of binary files within the online documentation
  • Loading branch information
terhorstd authored Jun 30, 2023
2 parents 1a1f32e + f30bafe commit e441a55
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions doc/htmldoc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,9 @@ def patch_documentation(patch_url):
3. retrieve the patch
"""

print("Preparing patch...")
try:
git_dir = repo_root_dir / ".git"
git_dir = f"{repo_root_dir}/.git"
git_hash = subprocess.check_output(
f"GIT_DIR='{git_dir}' git rev-parse HEAD", shell=True, encoding="utf8"
).strip()
Expand All @@ -398,7 +397,7 @@ def patch_documentation(patch_url):
print(f" retrieving {patch_url}")
urlretrieve(patch_url, patch_file)
print(f" applying {patch_file}")
result = subprocess.check_output("patch -p3", stdin=open(patch_file, "r"), stderr=subprocess.STDOUT, shell=True)
result = subprocess.check_output(f"git apply '{patch_file}'", stderr=subprocess.STDOUT, shell=True)
print(f"Patch result: {result}")
except Exception as exc:
print(f"Error while applying patch: {exc}")
Expand Down

0 comments on commit e441a55

Please sign in to comment.