1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 15:39:43 +00:00

adding checks for #5

This commit is contained in:
deadc0de6
2017-05-20 08:48:59 +02:00
parent e3a7b32fba
commit bc75bf8117
2 changed files with 5 additions and 0 deletions

View File

@@ -67,6 +67,9 @@ class Installer:
if content is None:
self.log.err('generate from template \"%s\"' % (src))
return []
if not os.path.exists(src):
self.log.err('installing %s to %s' % (src, dst))
return []
st = os.stat(src)
ret = self._write(dst, content, st.st_mode)
if ret < 0:

View File

@@ -32,6 +32,8 @@ class Templategen:
comment_end_string=COMMENT_END)
def generate(self, src, profile):
if not os.path.exists(src):
return ''
return self._handle_file(src, profile)
def _handle_file(self, src, profile):