Skip to content

Commit

Permalink
Fix issue 24: macOS: dotnet from fixed path when DOTNET_ROOT not set (#…
Browse files Browse the repository at this point in the history
…25)

* Fix issue 24: Find dotnet on macos from fixed location when DOTNET_ROOT is not defined

Co-authored-by: LUFF,VINCE (K-UnitedKingdom,ex1) <[email protected]>
  • Loading branch information
DareDevilDenis and LUFF,VINCE (K-UnitedKingdom,ex1) authored Mar 1, 2022
1 parent d36d548 commit 6d6f7a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions clr_loader/util/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ def find_dotnet_root() -> str:
# On Windows, the host library is stored separately from dotnet.exe for x86
prog_files = os.environ.get("ProgramFiles")
dotnet_root = os.path.join(prog_files, "dotnet")
if os.path.isdir(dotnet_root):
return dotnet_root
elif sys.platform == "darwin":
dotnet_root = "/usr/local/share/dotnet"

if dotnet_root is not None and os.path.isdir(dotnet_root):
return dotnet_root

# Try to discover dotnet from PATH otherwise
dotnet_path = shutil.which("dotnet")
Expand Down

0 comments on commit 6d6f7a1

Please sign in to comment.