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:
Peter Huene 2018-06-26 16:34:00 -07:00
parent 8cffe4a578
commit 92507184bd
No known key found for this signature in database
GPG key ID: E1D265D820213D6A
16 changed files with 103 additions and 0 deletions

View file

@ -49,5 +49,23 @@ namespace Microsoft.DotNet.Tests
.And
.HaveStdErrContaining(CliFolderPathCalculator.DotnetHomeVariableName);
}
[Fact]
public void GivenASpecifiedDotnetCliHomeVariableItPrintsUsageMessage()
{
var home = Path.Combine(TempRoot.Root, Path.GetRandomFileName());
new TestCommand("dotnet")
.WithEnvironmentVariable(CliFolderPathCalculator.DotnetHomeVariableName, home)
.ExecuteWithCapturedOutput("-d help")
.Should()
.Pass()
.And
.HaveStdOutContaining(
string.Format(
LocalizableStrings.DotnetCliHomeUsed,
home,
CliFolderPathCalculator.DotnetHomeVariableName));
}
}
}