From 256fbd84098b947fe9d9a5fa9cb58ba20cb230be Mon Sep 17 00:00:00 2001 From: underscorediscovery Date: Wed, 1 Oct 2014 20:14:09 -0230 Subject: [PATCH] build targets; add better error checking for when flow info command fails (https://github.com/underscorediscovery/flow/issues/23) --- flow.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/flow.py b/flow.py index 9edc511..1e142cf 100644 --- a/flow.py +++ b/flow.py @@ -246,11 +246,16 @@ def get_targets(self): _result.append(['iOS', 'mobile, native ios project']) _result.append(['Web', 'web, web based app']) - _invalid = self.info_json['targets_invalid'] + if self.info_json: - _result[:] = [_item for _item in _result if not _item[0].lower() in _invalid ] + _invalid = self.info_json['targets_invalid'] + _result[:] = [_item for _item in _result if not _item[0].lower() in _invalid ] - _result.insert(0, ['unavailable from ' + self.system, ", ".join(_invalid) ]) + _result.insert(0, ['unavailable from ' + self.system, ", ".join(_invalid) ]) + + else : + + _result.append(['Error', 'Failed to retrieve flow info from project. View -> Show Console for more info to report!']) return _result