mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge 244ba4dda9 into 24866b77c7
This commit is contained in:
commit
f6706581fd
2 changed files with 3 additions and 3 deletions
|
|
@ -597,7 +597,7 @@ class SourceFileGenerator(Generator):
|
|||
output_path, _ = os.path.splitext(obj.save_as)
|
||||
dest = os.path.join(self.output_path,
|
||||
output_path + self.output_extension)
|
||||
copy('', obj.source_path, dest)
|
||||
copy('', obj.source_path, dest, is_file=True)
|
||||
|
||||
def generate_output(self, writer=None):
|
||||
logger.info(' Generating source files...')
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ def slugify(value, substitutions=()):
|
|||
return value.decode('ascii')
|
||||
|
||||
|
||||
def copy(path, source, destination, destination_path=None):
|
||||
def copy(path, source, destination, destination_path=None, is_file=False):
|
||||
"""Copy path from origin to destination.
|
||||
|
||||
The function is able to copy either files or directories.
|
||||
|
|
@ -273,7 +273,7 @@ def copy(path, source, destination, destination_path=None):
|
|||
destination_ = os.path.abspath(
|
||||
os.path.expanduser(os.path.join(destination, destination_path)))
|
||||
|
||||
if not os.path.exists(destination_):
|
||||
if not os.path.exists(destination_) and not is_file:
|
||||
os.makedirs(destination_)
|
||||
|
||||
def recurse(source, destination):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue