1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-10 03:59:17 +00:00

improve error check on external commands

This commit is contained in:
deadc0de6
2018-09-28 14:08:33 +02:00
parent 1ea1e004e5
commit 8aabf57204
3 changed files with 22 additions and 12 deletions

View File

@@ -52,7 +52,8 @@ class Templategen:
def _handle_file(self, src):
"""generate the file content from template"""
filetype = utils.run(['file', '-b', src], raw=False, debug=self.debug)
_, filetype = utils.run(['file', '-b', src],
raw=False, debug=self.debug)
filetype = filetype.strip()
if self.debug:
self.log.dbg('\"{}\" filetype: {}'.format(src, filetype))