From 2066c0332d754a974a9fae36d61d855d9c11a2d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Fri, 13 Jan 2023 08:12:29 +0100 Subject: [PATCH] fix: Avoid exception when input is missing for diff and deploy --- mastodon_blocklist_deploy/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mastodon_blocklist_deploy/cli.py b/mastodon_blocklist_deploy/cli.py index d8ccaee..0341d24 100644 --- a/mastodon_blocklist_deploy/cli.py +++ b/mastodon_blocklist_deploy/cli.py @@ -96,7 +96,11 @@ def cli(): blocklist_filename = args.input_file else: blocklist_filename = "../blocklist.toml" - local_blocklist = load_blocklist_file(blocklist_filename) + try: + local_blocklist = load_blocklist_file(blocklist_filename) + except FileNotFoundError: + print("Local blocklist file was not found. Make sure to specify it's location via -i") + exit() if args.action == "diff": Instance.show_diffs(local_blocklist, remote_blocklist)