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

Fix issue 24: macOS: dotnet from fixed path when DOTNET_ROOT not set #25

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
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