Skip to content

Commit

Permalink
fix(package): fixes handling for wrong name
Browse files Browse the repository at this point in the history
The @name_to_guid decorator didn't handle the case when valid package
is not found based on the name. This commit fixes the behaviour by
erroring out explicitly.
  • Loading branch information
ankitrgadiya committed Dec 27, 2021
1 parent 020b096 commit 4607022
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions riocli/package/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ def get_package_name(client: Client, guid: str) -> str:

def find_package_guid(client: Client, name: str, version: str = None) -> str:
packages = client.get_all_packages(name=name, version=version)
if len(packages) == 0:
click.secho("package not found", fg='red')
exit(1)

if len(packages) == 1:
return packages[0].packageId

Expand Down

0 comments on commit 4607022

Please sign in to comment.