mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Ensure path & output path comparisons are absolute
Otherwise, the following error could be returned: "ValueError: Can't mix absolute and relative paths"
This commit is contained in:
parent
82ff563f6f
commit
a15f2aba76
1 changed files with 3 additions and 2 deletions
|
|
@ -100,8 +100,9 @@ class Pelican:
|
|||
# Delete the output directory if (1) the appropriate setting is True
|
||||
# and (2) that directory is not the parent of the source directory
|
||||
if (self.delete_outputdir
|
||||
and os.path.commonpath([self.output_path]) !=
|
||||
os.path.commonpath([self.output_path, self.path])):
|
||||
and os.path.commonpath([os.path.realpath(self.output_path)]) !=
|
||||
os.path.commonpath([os.path.realpath(self.output_path),
|
||||
os.path.realpath(self.path)])):
|
||||
clean_output_dir(self.output_path, self.output_retention)
|
||||
|
||||
for p in generators:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue