From 81355a783f652313c8d30e5045a1cdf47ba74bce Mon Sep 17 00:00:00 2001 From: romill Date: Thu, 25 Jan 2024 16:12:47 +0530 Subject: [PATCH] fix(package): prints error during delete when no packages found This commit fixes the bug in the rio package delete command when no packages are found and the command prints "Nothing to delete" and returns a zero exit code. While this was mostly okay, it's not script friendly or automation friendly. This commit fixes the bug. --- riocli/package/delete.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/riocli/package/delete.py b/riocli/package/delete.py index b7405a4b..7cfe3390 100644 --- a/riocli/package/delete.py +++ b/riocli/package/delete.py @@ -62,9 +62,9 @@ def delete_package( raise SystemExit(1) from e if not packages: - spinner.text = "Nothing to delete" - spinner.green.ok(Symbols.SUCCESS) - return + spinner.text = click.style("Package(s) not found", Colors.RED) + spinner.red.fail(Symbols.ERROR) + raise SystemExit(1) with spinner.hidden(): print_packages_for_confirmation(packages)