only add symlink if it doesn't already exist

This commit is contained in:
Benedikt Bartscher 2024-07-04 20:55:09 +02:00
parent 4696f49a03
commit 1c4c9fd515
No known key found for this signature in database

View File

@ -89,7 +89,9 @@ def asset(
dst_file = asset_folder / filename
if not dst_file.exists():
if not dst_file.exists() and (
not dst_file.is_symlink() or dst_file.resolve() != src_file_shared.resolve()
):
dst_file.symlink_to(src_file_shared)
asset_url = f"/{external}/{subfolder}/{filename}"