From a05c6c35b45f92feb7ea694b6926cf3fba53bee4 Mon Sep 17 00:00:00 2001 From: Nat Chin Date: Wed, 8 Nov 2023 14:06:22 -0500 Subject: [PATCH] Install latest if no binaries are found --- solc_select/__main__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/solc_select/__main__.py b/solc_select/__main__.py index af06c92..b657114 100644 --- a/solc_select/__main__.py +++ b/solc_select/__main__.py @@ -19,6 +19,7 @@ halt_incompatible_system, halt_old_architecture, upgrade_architecture, + get_latest_release ) # pylint: disable=too-many-branches @@ -40,7 +41,7 @@ def solc_select() -> None: parser_use = subparsers.add_parser("use", help="change the version of global solc compiler") parser_use.add_argument( USE_VERSION, help="solc version you want to use (eg: 0.4.25)", type=valid_version, nargs="?" - ) + ) parser_use.add_argument("--always-install", action="store_true") parser_use = subparsers.add_parser("versions", help="prints out all installed solc versions") parser_use.add_argument(SHOW_VERSIONS, nargs="*", help=argparse.SUPPRESS) @@ -84,6 +85,9 @@ def solc_select() -> None: def solc() -> None: + if installed_versions() == []: + print("No solc versions found, installing latest") + switch_global_version(version=get_latest_release(),always_install=True) res = current_version() if res: (version, _) = res