1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-08 14:19:16 +00:00

create directory hierarchy even when not containing files

This commit is contained in:
deadc0de6
2018-07-16 20:40:33 +02:00
parent 36fdb943b2
commit 2243ddfc64
4 changed files with 16 additions and 5 deletions

View File

@@ -24,6 +24,7 @@ class Templategen:
def __init__(self, base='.', debug=False):
self.base = base.rstrip(os.sep)
self.debug = debug
loader = FileSystemLoader(self.base)
self.env = Environment(loader=loader,
trim_blocks=True, lstrip_blocks=True,
@@ -43,7 +44,8 @@ class Templategen:
def _handle_file(self, src, profile):
"""generate the file content from template"""
filetype = utils.run(['file', '-b', src], raw=False).strip()
filetype = utils.run(['file', '-b', src], raw=False, debug=self.debug)
filetype = filetype.strip()
self.log.dbg('\"{}\" filetype: {}'.format(src, filetype))
istext = 'text' in filetype
self.log.dbg('\"{}\" is text: {}'.format(src, istext))