Skip to content

Commit 841689c

Browse files
authored
Merge pull request #222 from AA-Turner/always-purge-symlink
Always purge symlinks
2 parents bbf1112 + e0c1fed commit 841689c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

build_docs.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -995,12 +995,13 @@ 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+
if not link.exists() or readlink(link) != directory:
1000+
# Link does not exist or points to the wrong target.
1001+
if link.exists():
1002+
link.unlink()
1003+
link.symlink_to(directory)
1004+
run(["chown", "-h", f":{group}", str(link)])
10041005
if not skip_cache_invalidation:
10051006
surrogate_key = f"{language.tag}/{name}"
10061007
purge_surrogate_key(http, surrogate_key)

0 commit comments

Comments
 (0)