Skip to content

Commit

Permalink
Merge pull request #222 from AA-Turner/always-purge-symlink
Browse files Browse the repository at this point in the history
Always purge symlinks
  • Loading branch information
hugovk authored Oct 24, 2024
2 parents bbf1112 + e0c1fed commit 841689c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -995,12 +995,13 @@ def symlink(
directory_path = path / directory
if not directory_path.exists():
return # No touching link, dest doc not built yet.
if link.exists() and readlink(link) == directory:
return # Link is already pointing to right doc.
if link.exists():
link.unlink()
link.symlink_to(directory)
run(["chown", "-h", ":" + group, str(link)])

if not link.exists() or readlink(link) != directory:
# Link does not exist or points to the wrong target.
if link.exists():
link.unlink()
link.symlink_to(directory)
run(["chown", "-h", f":{group}", str(link)])
if not skip_cache_invalidation:
surrogate_key = f"{language.tag}/{name}"
purge_surrogate_key(http, surrogate_key)
Expand Down

0 comments on commit 841689c

Please sign in to comment.