Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix to find dotnet root using architecture name #41

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

Closed
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
13 changes: 9 additions & 4 deletions clr_loader/util/find.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import os.path
import platform
import shutil
import sys
from pathlib import Path
Expand Down Expand Up @@ -42,10 +43,14 @@ def find_dotnet_root() -> Path:
prog_files = Path(prog_files)
dotnet_root = prog_files / "dotnet"
elif sys.platform == "darwin":
if sys.maxsize > 2**32: # is_64bits
dotnet_root = Path("/usr/local/share/dotnet/x64")
else:
dotnet_root = Path("/usr/local/share/dotnet")
dotnet_exec_paths = (
Path("/usr/local/share/dotnet/dotnet"),
Path("/usr/local/share/dotnet/x64/dotnet"))

for dotnet_exec in dotnet_exec_paths:
if dotnet_exec.is_file():
dotnet_root = dotnet_exec.parent.absolute()
break

if dotnet_root is not None and dotnet_root.is_dir():
return dotnet_root
Expand Down