Skip to content

Commit

Permalink
Fix symbolic link handling in pelican-themes -s/-c (#3392)
Browse files Browse the repository at this point in the history
  • Loading branch information
frederik-elwert authored Sep 28, 2024
1 parent 0cb445c commit 08283b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pelican/tools/pelican_themes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)


Expand Down

0 comments on commit 08283b4

Please sign in to comment.