Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Sep 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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