Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs message instead of error if no versions exist for solc-select versions #154

Merged
merged 2 commits into from
Feb 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions solc_select/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,20 @@ def solc_select() -> None:
switch_global_version(args.get(USE_VERSION), args.get("always_install"))

elif args.get(SHOW_VERSIONS) is not None:
res = current_version()
if res:
(current_ver, source) = res
for version in reversed(sorted(installed_versions())):
if res and version == current_ver:
print(f"{version} (current, set by {source})")
else:
print(version)
versions_installed = installed_versions()
if versions_installed:
res = current_version()
if res:
(current_ver, source) = res
for version in reversed(sorted(versions_installed)):
if res and version == current_ver:
print(f"{version} (current, set by {source})")
else:
print(version)
else:
print(
"No solc version installed. Run `solc-select install --help` for more information"
)
elif args.get(UPGRADE) is not None:
upgrade_architecture()
else:
Expand Down