Skip to content

Commit

Permalink
set DOTNET_ROOT in exec_env
Browse files Browse the repository at this point in the history
Use exec-env [1] to set DOTNET_ROOT.

1: https://asdf-vm.com/plugins/create.html#bin-exec-env
  • Loading branch information
rb committed Apr 6, 2023
1 parent 4583e4b commit 67a8c58
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bin/exec-env
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 67a8c58

Please sign in to comment.