mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 17:55:27 +00:00
[cli] Disable update notice if JSON/CSV/TSV output are used
This commit is contained in:
parent
d82870a5d3
commit
6876371325
|
@ -1435,8 +1435,17 @@ def main():
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
logger.info('Command was aborted via KeyboardInterrupt, cleaning up...')
|
logger.info('Command was aborted via KeyboardInterrupt, cleaning up...')
|
||||||
|
|
||||||
|
# Disable the update message if JSON/TSV/CSV outputs are used
|
||||||
|
disable_update_message = False
|
||||||
|
if hasattr(args, 'json'):
|
||||||
|
disable_update_message = args.json
|
||||||
|
if not disable_update_message and hasattr(args, 'tsv'):
|
||||||
|
disable_update_message = args.tsv
|
||||||
|
if not disable_update_message and hasattr(args, 'csv'):
|
||||||
|
disable_update_message = args.csv
|
||||||
|
|
||||||
# show note if update is available
|
# show note if update is available
|
||||||
if cli.core.update_available and cli.core.update_notice_enabled():
|
if not disable_update_message and cli.core.update_available and cli.core.update_notice_enabled():
|
||||||
if update_info := cli.core.get_update_info():
|
if update_info := cli.core.get_update_info():
|
||||||
print(f'\nLegendary update available!')
|
print(f'\nLegendary update available!')
|
||||||
print(f'- New version: {update_info["version"]} - "{update_info["name"]}"')
|
print(f'- New version: {update_info["version"]} - "{update_info["name"]}"')
|
||||||
|
|
Loading…
Reference in a new issue