Skip to content

Commit

Permalink
Merge pull request #41 from iamdefinitelyahuman/osx-which
Browse files Browse the repository at this point in the history
include which when importing installed versions on OSX
  • Loading branch information
iamdefinitelyahuman committed Feb 16, 2020
2 parents 691b474 + bc5160f commit 77eb6ea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Unreleased
----------

- Include `which` when importing installed versions on OSX

0.7.2
-----

Expand Down
24 changes: 12 additions & 12 deletions solcx/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ def _import_version(path):

def import_installed_solc():
platform = _get_platform()
if platform == 'linux':
# on Linux, copy active version of solc
path_list = [
subprocess.run(['which', 'solc'], stdout=subprocess.PIPE).stdout.decode().strip()
]
if not path_list[0]:
return
elif platform == 'darwin':
# on OSX, copy all versions of solc from cellar
path_list = [str(i) for i in Path('/usr/local/Cellar').glob('solidity*/**/solc')]
else:
# on Windows, do nothing
if platform == "win32":
return

# copy active version of solc
path_list = []
which = subprocess.run(['which', 'solc'], stdout=subprocess.PIPE).stdout.decode().strip()
if which:
path_list.append(which)

# on OSX, also copy all versions of solc from cellar
if platform == "darwin":
path_list = [str(i) for i in Path('/usr/local/Cellar').glob('solidity*/**/solc')]

for path in path_list:
try:
version = _import_version(path)
Expand Down

0 comments on commit 77eb6ea

Please sign in to comment.