Preserve file metadata (esp. timestamps) when copy static files to output folder.

This commit is contained in:
zhouji 2013-10-15 10:37:03 +08:00
commit eb6d4bb008
2 changed files with 3 additions and 3 deletions

View file

@ -573,7 +573,7 @@ class StaticGenerator(Generator):
source_path = os.path.join(self.path, sc.source_path)
save_as = os.path.join(self.output_path, sc.save_as)
mkdir_p(os.path.dirname(save_as))
shutil.copy(source_path, save_as)
shutil.copy2(source_path, save_as)
logger.info('copying {} to {}'.format(sc.source_path, sc.save_as))