From eac9fbde239d40ed5e6afe9e61a622c849ce16a5 Mon Sep 17 00:00:00 2001 From: Obijuan Date: Wed, 19 Jun 2024 13:16:22 +0200 Subject: [PATCH] icm ls: Print a message if no collections installed --- icm/commands/cmd_ls.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/icm/commands/cmd_ls.py b/icm/commands/cmd_ls.py index 8dd0d15..48c3b10 100644 --- a/icm/commands/cmd_ls.py +++ b/icm/commands/cmd_ls.py @@ -25,6 +25,11 @@ def main(): # -- Sort the list of collections list_col.sort() - # -- Print all the available collections - for colection in list_col: - click.secho(f"• {colection}", fg="blue") + # -- List not empty: Print it! + if list_col: + # -- Print all the available collections + for colection in list_col: + click.secho(f"• {colection}", fg="blue") + + else: + print("No installed collections")