From 67a8c581a556cd5f671dc1e89b5ec1122126a2e7 Mon Sep 17 00:00:00 2001 From: rb Date: Thu, 6 Apr 2023 15:06:24 +0200 Subject: [PATCH] set DOTNET_ROOT in exec_env Use exec-env [1] to set DOTNET_ROOT. 1: https://asdf-vm.com/plugins/create.html#bin-exec-env --- bin/exec-env | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bin/exec-env diff --git a/bin/exec-env b/bin/exec-env new file mode 100755 index 0000000..5ac7ef1 --- /dev/null +++ b/bin/exec-env @@ -0,0 +1,14 @@ +asdf_update_dotnet_home() { + local dotnet_path + dotnet_path="$(rtx which dotnet 2> /dev/null )" + if [[ -n "${dotnet_path}" ]]; then + export DOTNET_ROOT + DOTNET_ROOT="$(dirname "$(realpath "${dotnet_path}")")" + fi +} + +prompt_command() { + asdf_update_dotnet_home +} + +asdf_update_dotnet_home