Skip to content

Commit e617459

Browse files
committed
[docs] Fixed stable symlink not updating when changed
1 parent 9bcc94a commit e617459

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/management/commands/update_docs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,9 @@ def _setup_stable_symlink(self, release, built_dir):
369369
"""
370370
stable = built_dir / "stable"
371371
target = built_dir / release.version
372-
stable.symlink_to(target, target_is_directory=True)
372+
if stable.resolve() != target: # Symlink is either missing or has changed
373+
stable.unlink(missing_ok=True)
374+
stable.symlink_to(target, target_is_directory=True)
373375

374376

375377
def gen_decoded_documents(directory):

0 commit comments

Comments
 (0)