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:
@@ -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:
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user