crytic / solc-select

Manage and switch between Solidity compiler versions
GNU Affero General Public License v3.0
758 stars 103 forks source link

Adds `--always-install` flag to `solc-select use` #79

Closed 0xicingdeath closed 3 years ago

0xicingdeath commented 3 years ago
$ solc-select use 0.8.9
'0.8.9' must be installed prior to use. Would you like to install? [y/n] n

$ solc-select use 0.8.9
'0.8.9' must be installed prior to use. Would you like to install? [y/n] y
Installing '0.8.9'...
Version '0.8.9' installed.
Switched global version to 0.8.9
0xicingdeath commented 3 years ago

Replaced the above with an --always-install flag that will install and change the version, if applicable. Closes #73.

$ solc-select use 0.8.9 --always-install
Installing '0.8.9'...
Version '0.8.9' installed.
Switched global version to 0.8.9

$ solc-select use 0.8.9
Traceback (most recent call last):
  File "/Users/nataliechin/.virtualenvs/ss/bin/solc-select", line 33, in <module>
    sys.exit(load_entry_point('solc-select', 'console_scripts', 'solc-select')())
  File "/Users/nataliechin/GitHub/solc-select/solc_select/__main__.py", line 60, in solc_select
    switch_global_version(args.get(USE_VERSION), args.get("always_install"))
  File "/Users/nataliechin/GitHub/solc-select/solc_select/solc_select.py", line 122, in switch_global_version
    raise argparse.ArgumentTypeError(f"'{version}' must be installed prior to use.")
argparse.ArgumentTypeError: '0.8.9' must be installed prior to use.