mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #1183 from Rogdham/pelican-fixcopy
Fix `utils.copy` for copying files
This commit is contained in:
commit
dcadf33988
3 changed files with 97 additions and 15 deletions
|
|
@ -554,8 +554,12 @@ class StaticGenerator(Generator):
|
|||
final_path=None):
|
||||
"""Copy all the paths from source to destination"""
|
||||
for path in paths:
|
||||
copy(path, source, os.path.join(output_path, destination),
|
||||
final_path)
|
||||
if final_path:
|
||||
copy(os.path.join(source, path),
|
||||
os.path.join(output_path, destination, final_path))
|
||||
else:
|
||||
copy(os.path.join(source, path),
|
||||
os.path.join(output_path, destination, path))
|
||||
|
||||
def generate_context(self):
|
||||
self.staticfiles = []
|
||||
|
|
@ -597,7 +601,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)
|
||||
|
||||
def generate_output(self, writer=None):
|
||||
logger.info(' Generating source files...')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue