Fix symbolic link handling in pelican-themes -s/-c

This commit is contained in:
Frederik Elwert 2024-09-13 09:30:01 +02:00
commit 98bb144e71
2 changed files with 5 additions and 1 deletions

3
RELEASE.md Normal file
View file

@ -0,0 +1,3 @@
Release type: minor
Fix symlink handling in `pelican-themes`.

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)