This commit is contained in:
rjames86 2014-02-05 15:39:46 +00:00
commit f6706581fd
2 changed files with 3 additions and 3 deletions

View file

@ -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...')

View file

@ -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):