Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
Comment on lines +1001 to +1002
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this could be simplified further by replacing these two lines with link.unlink(missing_ok=True).

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