Skip to content

Commit 6d6f7a1

Browse files
DareDevilDenisLUFF,VINCE (K-UnitedKingdom,ex1)
andauthored
Fix issue 24: macOS: dotnet from fixed path when DOTNET_ROOT not set (#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]>
1 parent d36d548 commit 6d6f7a1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

clr_loader/util/find.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ def find_dotnet_root() -> str:
1313
# On Windows, the host library is stored separately from dotnet.exe for x86
1414
prog_files = os.environ.get("ProgramFiles")
1515
dotnet_root = os.path.join(prog_files, "dotnet")
16-
if os.path.isdir(dotnet_root):
17-
return dotnet_root
16+
elif sys.platform == "darwin":
17+
dotnet_root = "/usr/local/share/dotnet"
18+
19+
if dotnet_root is not None and os.path.isdir(dotnet_root):
20+
return dotnet_root
1821

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

0 commit comments

Comments
 (0)