readme_generator: check that logo exists#33
Conversation
| else: | ||
| return False | ||
| except requests.exceptions.RequestException as err: | ||
| raise Exception("Can't check URL:", err) |
There was a problem hiding this comment.
Would raising an exception stop the execution of the whole script? If so, maybe only a warning should be output, and the function still return False?
There was a problem hiding this comment.
I wondered about that too, but couldn't imagine a case where that would be an issue that the script stops if requests is failing. On a second thought, I now have in mind one impact which is that this script cannot be run offline anymore (requests would raise an exception).
I wonder what would be the point of risking to generate an incomplete readme anyway (i.e. having return False in this case too even if it actually has one) though?
If that's important to be able to run that script offline, the only way i can think of would be to store a list of existing logos to compare from within this repo, that could be updated via a Github worflow... but it sounds a bit more complex than the current proposal.
This PR to readme generator script makes it check that logo for a given app actually exists before linking to it in the readme.
It will prevent broken readme as in the following example: https://github.com/YunoHost-Apps/marl_ynh/blob/7ec7b7759766da9d86f5c88eb780d81e93857fe8/README.md