Blame SOURCES/sdk-telemetry-optout.patch

ced12e
diff --git a/src/Cli/dotnet/Program.cs b/src/Cli/dotnet/Program.cs
ced12e
index de1ebb9e6..6bbf479de 100644
ced12e
--- a/src/Cli/dotnet/Program.cs
ced12e
+++ b/src/Cli/dotnet/Program.cs
ced12e
@@ -28,6 +28,13 @@ public class Program
ced12e
 
ced12e
         public static int Main(string[] args)
ced12e
         {
ced12e
+            // opt out of telemetry by default if the env var is unset
ced12e
+            string telemetryValue = Environment.GetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT");
ced12e
+            if (String.IsNullOrEmpty(telemetryValue))
ced12e
+            {
ced12e
+                Environment.SetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
ced12e
+            }
ced12e
+
ced12e
             DebugHelper.HandleDebugSwitch(ref args);
ced12e
 
ced12e
             // Capture the current timestamp to calculate the host overhead.