Fix symbolic link handling in pelican-themes -s/-c (#3392)

This commit is contained in:
Frederik Elwert 2024-09-28 18:55:22 +02:00 committed by GitHub
commit 08283b4915
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -249,6 +249,7 @@ def install(path, v=False, u=False):
def symlink(path, v=False):
"""Symbolically link a theme"""
path = os.path.realpath(path)
if not os.path.exists(path):
err(path + " : no such file or directory")
elif not os.path.isdir(path):
@ -269,7 +270,7 @@ def symlink(path, v=False):
def is_broken_link(path):
"""Returns True if the path given as is a broken symlink"""
path = os.readlink(path)
path = os.path.realpath(path)
return not os.path.exists(path)