When you try to run eatlocal display <bite-no> without having downloaded the bite first, you will get a very long error message resulting in an IndexError because there is no html file in the local repo: html_file = path / list(path.glob("*.html"))[0]. This is expected but the user should be informed that they can only display bites that were downloaded before. So we should check first, if there is a path for that bite number.
When you try to run
eatlocal display <bite-no>
without having downloaded the bite first, you will get a very long error message resulting in anIndexError
because there is no html file in the local repo:html_file = path / list(path.glob("*.html"))[0]
. This is expected but the user should be informed that they can only display bites that were downloaded before. So we should check first, if there is a path for that bite number.Should be a very easy fix.
Given the line:
it should suffice to check if that path is an existing directory and if not, display a warning message on the console.