Skip to content

Commit

Permalink
fix(package): prints error during delete when no packages found
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
RomilShah authored and pallabpain committed Jan 25, 2024
1 parent 35fa0f4 commit 81355a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions riocli/package/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 81355a7

Please sign in to comment.