From 342e887cc8200cb154e51a00300528578d5c385c Mon Sep 17 00:00:00 2001 From: Mike Lei Date: Thu, 19 May 2022 12:48:22 +0100 Subject: [PATCH] [cli] Set exit status to 1 if exited with errors --- chat_downloader/chat_downloader.py | 5 +++++ chat_downloader/cli.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/chat_downloader/chat_downloader.py b/chat_downloader/chat_downloader.py index 0ce16d3..fe6ea2a 100644 --- a/chat_downloader/chat_downloader.py +++ b/chat_downloader/chat_downloader.py @@ -385,5 +385,10 @@ def callback(item): else: log('error', 'Keyboard Interrupt') + else: # No exceptions raised + return + finally: downloader.close() + + return 1 diff --git a/chat_downloader/cli.py b/chat_downloader/cli.py index 3fa035b..3950dd8 100644 --- a/chat_downloader/cli.py +++ b/chat_downloader/cli.py @@ -191,4 +191,4 @@ def add_init_param(group, *keys, **kwargs): set_log_level(args.logging) # Run with these arguments - run(**args.__dict__) + return run(**args.__dict__)