diff --git a/README.md b/README.md index 90998e8..82c3908 100644 --- a/README.md +++ b/README.md @@ -12,32 +12,15 @@ # Contents - [Dependencies](#dependencies) -- [Telemetry](#telemetry) - [Install](#install) - [Contributing](#contributing) - [License](#license) -- [Updating DOTNET_ROOT and MsBuildSDksPath](#updating-variables) +- [Updating global environment variables](#updating-variables) # Dependencies - `bash`, `curl`, `grep`, `sed`, `git`: generic POSIX utilities. -# Telemetry - -> :warning: Once installed, the .NET SDK will collect telemetry by default ([learn more](https://learn.microsoft.com/en-us/dotnet/core/tools/telemetry#how-to-opt-out)). If you don't want to send analytics data to Microsoft, follow the instructions below before (or after) installing the SDK. - -To disable telemetry, add the following line to your shell profile (`~/.bashrc`, `~/.zshrc`, `~/.config/fish/config.fish`, etc.): - -```shell -export DOTNET_CLI_TELEMETRY_OPTOUT=1 -``` - -Once added, reload your profile for the changes to take effect. - -```shell -exec $SHELL -``` - # Install Installing this plugin: @@ -67,9 +50,15 @@ dotnet --version Check [asdf](https://github.com/asdf-vm/asdf) readme for more instructions on how to install & manage versions. -# Updating DOTNET_ROOT and MsBuildSDksPath +# Updating global environment variables + +If you need to: + +- update/set `DOTNET_ROOT` variable +- update/set `MsBuildSDksPath` variable +- disable telemetry (i.e. set `DOTNET_CLI_TELEMETRY_OPTOUT` to 1) -According to your shell, add the following instructions to update or set the DOTNET_ROOT and MsBuildSDksPath environment variables: +then, according to your shell, execute one of the following commands: For bash, use: diff --git a/set-dotnet-env.bash b/set-dotnet-env.bash index 05edbcf..95ada7b 100644 --- a/set-dotnet-env.bash +++ b/set-dotnet-env.bash @@ -7,6 +7,7 @@ asdf_update_dotnet_home() { export MSBuildSDKsPath DOTNET_VERSION="$(dotnet --version)" export MSBuildSDKsPath="$DOTNET_ROOT/sdk/$DOTNET_VERSION/Sdks" + export DOTNET_CLI_TELEMETRY_OPTOUT=1 fi } diff --git a/set-dotnet-env.fish b/set-dotnet-env.fish index b55fd42..96034ea 100644 --- a/set-dotnet-env.fish +++ b/set-dotnet-env.fish @@ -5,5 +5,6 @@ function asdf_update_dotnet_home --on-event fish_prompt set -gx DOTNET_ROOT (dirname "$full_path") set --local dotnet_version (string replace -r '.*/installs/dotnet/(.+)/[.].*' '$1' $dotnet_path) set -gx MSBuildSDKsPath (realpath "$DOTNET_ROOT/sdk/$dotnet_version/Sdks") + set -gx DOTNET_CLI_TELEMETRY_OPTOUT 1 end end diff --git a/set-dotnet-env.zsh b/set-dotnet-env.zsh index 7a226ef..03a1c9d 100644 --- a/set-dotnet-env.zsh +++ b/set-dotnet-env.zsh @@ -7,6 +7,7 @@ asdf_update_dotnet_home() { export MSBuildSDKsPath DOTNET_VERSION="$(dotnet --version)" export MSBuildSDKsPath="$DOTNET_ROOT/sdk/$DOTNET_VERSION/Sdks" + export DOTNET_CLI_TELEMETRY_OPTOUT=1 fi }