forked from toolshed/abra
		
	Gracefully handle README-parsing failures
This commit is contained in:
		| @ -137,6 +137,7 @@ def get_app_features(app_path): | |||||||
|         log.info(f"{app_path}/README.md") |         log.info(f"{app_path}/README.md") | ||||||
|         contents = handle.read() |         contents = handle.read() | ||||||
|  |  | ||||||
|  |     try: | ||||||
|         for match in findall(r"\*\*.*\s\*", contents): |         for match in findall(r"\*\*.*\s\*", contents): | ||||||
|             title = search(r"(?<=\*\*).*(?=\*\*)", match).group().lower() |             title = search(r"(?<=\*\*).*(?=\*\*)", match).group().lower() | ||||||
|  |  | ||||||
| @ -151,6 +152,11 @@ def get_app_features(app_path): | |||||||
|                 value = match.split(":")[-1].replace("*", "").strip() |                 value = match.split(":")[-1].replace("*", "").strip() | ||||||
|  |  | ||||||
|             features[title] = value |             features[title] = value | ||||||
|  |     except (IndexError, AttributeError): | ||||||
|  |         log.info(f"Can't parse {app_path}/README.md") | ||||||
|  |         return {} | ||||||
|  |     finally: | ||||||
|  |         _run_cmd("git checkout HEAD") | ||||||
|  |  | ||||||
|     log.info(f"Parsed {features}") |     log.info(f"Parsed {features}") | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user