Skip to content

Commit d708c71

Browse files
committed
Always purge symlinks
1 parent bbf1112 commit d708c71

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

build_docs.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -995,12 +995,14 @@ def symlink(
995995
directory_path = path / directory
996996
if not directory_path.exists():
997997
return # No touching link, dest doc not built yet.
998-
if link.exists() and readlink(link) == directory:
999-
return # Link is already pointing to right doc.
1000-
if link.exists():
1001-
link.unlink()
1002-
link.symlink_to(directory)
1003-
run(["chown", "-h", ":" + group, str(link)])
998+
999+
link_exists = link.exists()
1000+
if not link_exists or readlink(link) != directory:
1001+
# Link does not exist or points to the wrong target.
1002+
if link_exists:
1003+
link.unlink()
1004+
link.symlink_to(directory)
1005+
run(["chown", "-h", f":{group}", str(link)])
10041006
if not skip_cache_invalidation:
10051007
surrogate_key = f"{language.tag}/{name}"
10061008
purge_surrogate_key(http, surrogate_key)

0 commit comments

Comments
 (0)