diff --git a/mastodon_blocklist_deploy/cli.py b/mastodon_blocklist_deploy/cli.py index 07ad346..c75d598 100644 --- a/mastodon_blocklist_deploy/cli.py +++ b/mastodon_blocklist_deploy/cli.py @@ -120,12 +120,14 @@ def cli(): else: token = os.getenv('MBD_TOKEN') - """if there is a remote blocklist provided load this instead of fetching it from a server (for debugging reasons)""" - if args.remote_blocklist: - with open(args.remote_blocklist) as f: - remote_blocklist = blocklist_json_to_instances(json.load(f)) - else: - remote_blocklist = load_blocklist_from_instance(server=args.server, token=token) + """Get a remote blocklist only when necessary""" + if args.action in ["diff", "deploy"]: + """if there is a remote blocklist provided load this instead of fetching it from a server (for debugging reasons)""" + if args.remote_blocklist: + with open(args.remote_blocklist) as f: + remote_blocklist = blocklist_json_to_instances(json.load(f)) + else: + remote_blocklist = load_blocklist_from_instance(server=args.server, token=token) """Load local blocklist only when needed""" if args.action in ["diff", "deploy", "merge"]: