mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-09 22:14:17 +00:00
adding checks for #5
This commit is contained in:
@@ -67,6 +67,9 @@ class Installer:
|
|||||||
if content is None:
|
if content is None:
|
||||||
self.log.err('generate from template \"%s\"' % (src))
|
self.log.err('generate from template \"%s\"' % (src))
|
||||||
return []
|
return []
|
||||||
|
if not os.path.exists(src):
|
||||||
|
self.log.err('installing %s to %s' % (src, dst))
|
||||||
|
return []
|
||||||
st = os.stat(src)
|
st = os.stat(src)
|
||||||
ret = self._write(dst, content, st.st_mode)
|
ret = self._write(dst, content, st.st_mode)
|
||||||
if ret < 0:
|
if ret < 0:
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ class Templategen:
|
|||||||
comment_end_string=COMMENT_END)
|
comment_end_string=COMMENT_END)
|
||||||
|
|
||||||
def generate(self, src, profile):
|
def generate(self, src, profile):
|
||||||
|
if not os.path.exists(src):
|
||||||
|
return ''
|
||||||
return self._handle_file(src, profile)
|
return self._handle_file(src, profile)
|
||||||
|
|
||||||
def _handle_file(self, src, profile):
|
def _handle_file(self, src, profile):
|
||||||
|
|||||||
Reference in New Issue
Block a user