aboutsummaryrefslogtreecommitdiffstats
path: root/community/dotnet6-build/sdk_telemetry-optout.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/dotnet6-build/sdk_telemetry-optout.patch')
-rw-r--r--community/dotnet6-build/sdk_telemetry-optout.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/community/dotnet6-build/sdk_telemetry-optout.patch b/community/dotnet6-build/sdk_telemetry-optout.patch
new file mode 100644
index 00000000000..435a57f4e72
--- /dev/null
+++ b/community/dotnet6-build/sdk_telemetry-optout.patch
@@ -0,0 +1,32 @@
+From eb7141ec561b9a2551d16ee661343b87c5e5f1b1 Mon Sep 17 00:00:00 2001
+From: Antoine Martin <dev@ayakael.net>
+Date: Sun, 23 Jan 2022 15:47:27 +0000
+Subject: [PATCH 1/1] SDK telemetry optout
+
+Disables telemetry by default.
+
+---
+ src/Cli/dotnet/Program.cs | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/sdk/src/Cli/dotnet/Program.cs b/src/sdk/src/Cli/dotnet/Program.cs
+index c3be733b4a..2a157a75d5 100644
+--- a/src/sdk/src/Cli/dotnet/Program.cs
++++ b/src/sdk/src/Cli/dotnet/Program.cs
+@@ -27,6 +27,13 @@ public class Program
+
+ public static int Main(string[] args)
+ {
++ // opt out of telemetry by default if the env var is unset
++ string telemetryValue = Environment.GetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT");
++ if (String.IsNullOrEmpty(telemetryValue))
++ {
++ Environment.SetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
++ }
++
+ DebugHelper.HandleDebugSwitch(ref args);
+
+ // Capture the current timestamp to calculate the host overhead.
+--
+2.35.1
+