Log a verbose message when DOTNET_CLI_HOME is being used.
This commit logs a diagnostic message when the `DOTNET_CLI_HOME` variable is used. This enables users to determine where first-run-experience and global tool files are being written to. Fixes #9510.
This commit is contained in:
parent
8cffe4a578
commit
92507184bd
16 changed files with 103 additions and 0 deletions
|
@ -149,6 +149,8 @@ namespace Microsoft.DotNet.Cli
|
|||
bool skipFirstRunExperience =
|
||||
environmentProvider.GetEnvironmentVariableAsBool("DOTNET_SKIP_FIRST_TIME_EXPERIENCE", false);
|
||||
|
||||
ReportDotnetHomeUsage(environmentProvider);
|
||||
|
||||
topLevelCommandParserResult = new TopLevelCommandParserResult(command);
|
||||
var hasSuperUserAccess = false;
|
||||
if (IsDotnetBeingInvokedFromNativeInstaller(topLevelCommandParserResult))
|
||||
|
@ -229,6 +231,21 @@ namespace Microsoft.DotNet.Cli
|
|||
return exitCode;
|
||||
}
|
||||
|
||||
private static void ReportDotnetHomeUsage(IEnvironmentProvider provider)
|
||||
{
|
||||
var home = provider.GetEnvironmentVariable(CliFolderPathCalculator.DotnetHomeVariableName);
|
||||
if (string.IsNullOrEmpty(home))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reporter.Verbose.WriteLine(
|
||||
string.Format(
|
||||
LocalizableStrings.DotnetCliHomeUsed,
|
||||
home,
|
||||
CliFolderPathCalculator.DotnetHomeVariableName));
|
||||
}
|
||||
|
||||
private static bool IsDotnetBeingInvokedFromNativeInstaller(TopLevelCommandParserResult parseResult)
|
||||
{
|
||||
return parseResult.Command == "internal-reportinstallsuccess";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue