summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunil Kim <logyourself@gmail.com>2019-02-11 01:27:10 +0900
committerDominik Holland <dominik.holland@googlemail.com>2022-01-27 13:50:04 +0100
commit2a84a8ecb97dd68991821412296ae36b8768f625 (patch)
treef4e28db1014725964ce84d2407724b65ef8d0a0c
parent9161683aa0271a96ee64a4263f25e17bfdad7f14 (diff)
downloadqtivi-qface-2a84a8ecb97dd68991821412296ae36b8768f625.tar.gz
Fixes FileNotFoundError about the empty string path
-rw-r--r--qface/generator.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/qface/generator.py b/qface/generator.py
index 20d4487..e260ed4 100644
--- a/qface/generator.py
+++ b/qface/generator.py
@@ -194,7 +194,8 @@ class Generator(object):
def _write(self, file_path: Path, template: str, context: dict, preserve: bool = False, force: bool = False):
force = self.force or force
path = self.resolved_path / Path(self.apply(file_path, context))
- path.parent.makedirs_p()
+ if path.parent:
+ path.parent.makedirs_p()
logger.info('write {0}'.format(path))
data = self.render(template, context)
if self._has_different_content(data, path) or force: