From 9c3624449503f9c869b84d5c75310f2ea5d99122 Mon Sep 17 00:00:00 2001 From: "LUFF,VINCE (K-UnitedKingdom,ex1)" Date: Mon, 28 Feb 2022 09:51:36 +0000 Subject: [PATCH 1/2] Fix issue 24: Find dotnet on macos from fixed location when DOTNET_ROOT is not defined --- clr_loader/util/find.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clr_loader/util/find.py b/clr_loader/util/find.py index a38600e..c67a3c9 100644 --- a/clr_loader/util/find.py +++ b/clr_loader/util/find.py @@ -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 os.path.isdir(dotnet_root): + return dotnet_root # Try to discover dotnet from PATH otherwise dotnet_path = shutil.which("dotnet") From 8a0fc9d9b9785f6a227e530c241828de080706a5 Mon Sep 17 00:00:00 2001 From: "LUFF,VINCE (K-UnitedKingdom,ex1)" Date: Mon, 28 Feb 2022 10:34:16 +0000 Subject: [PATCH 2/2] Issue 24 fix: correct for linux --- clr_loader/util/find.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clr_loader/util/find.py b/clr_loader/util/find.py index c67a3c9..83b1bb1 100644 --- a/clr_loader/util/find.py +++ b/clr_loader/util/find.py @@ -16,7 +16,7 @@ def find_dotnet_root() -> str: elif sys.platform == "darwin": dotnet_root = "/usr/local/share/dotnet" - if os.path.isdir(dotnet_root): + if dotnet_root is not None and os.path.isdir(dotnet_root): return dotnet_root # Try to discover dotnet from PATH otherwise