Fixed bug where os.path.isfile(None) is called

This commit is contained in:
nathom 2021-03-27 13:34:02 -07:00
parent 9af6bf373a
commit 393dd3ee69

View file

@ -53,11 +53,12 @@ def cli(ctx, **kwargs):
logger.debug(f"handling {kwargs['urls']}") logger.debug(f"handling {kwargs['urls']}")
core.handle_urls(kwargs["urls"]) core.handle_urls(kwargs["urls"])
if os.path.isfile(kwargs['text']): if kwargs['text'] is not None:
logger.debug(f"Handling {kwargs['text']}") if os.path.isfile(kwargs['text']):
core.handle_txt(kwargs['text']) logger.debug(f"Handling {kwargs['text']}")
elif kwargs['txt'] is not None: core.handle_txt(kwargs['text'])
click.secho(f"Text file {kwargs['text']} does not exist.") else:
click.secho(f"Text file {kwargs['text']} does not exist.")
if ctx.invoked_subcommand is None: if ctx.invoked_subcommand is None:
core.download() core.download()