Skip to content

Commit 3c1be38

Browse files
CopilotmarcpopMSFT
andcommitted
Revert .Replace calls on DisplayName properties
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
1 parent a0aec01 commit 3c1be38

6 files changed

+10
-9
lines changed

src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ internal async Task<NewCommandStatus> EnterInstallFlowAsync(InstallCommandArgs a
245245
Reporter.Output.WriteLine(LocalizableStrings.TemplatePackageCoordinator_Install_Info_PackagesToBeInstalled);
246246
foreach (InstallRequest installRequest in installRequests)
247247
{
248-
Reporter.Output.WriteLine(installRequest.DisplayName.Replace("::", "@").Indent());
248+
Reporter.Output.WriteLine(installRequest.DisplayName.Indent());
249249
}
250250
Reporter.Output.WriteLine();
251251

@@ -643,7 +643,7 @@ private async Task<bool> ValidateInstallationRequestsAsync(InstallCommandArgs ar
643643
reporter.WriteCommand(
644644
Example
645645
.For<InstallCommand>(args.ParseResult)
646-
.WithArgument(BaseInstallCommand.NameArgument, installRequests.Select(ir => ir.DisplayName.Replace("::", "@")).ToArray())
646+
.WithArgument(BaseInstallCommand.NameArgument, installRequests.Select(ir => ir.DisplayName).ToArray())
647647
.WithOption(SharedOptions.ForceOption));
648648
return false;
649649
}

src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageDisplay.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ internal async Task DisplayInstallResultAsync(
103103
IEnumerable<ITemplateInfo> templates = await templatePackageManager.GetTemplatesAsync(result.TemplatePackage, cancellationToken).ConfigureAwait(false);
104104
if (templates.Any())
105105
{
106-
_reporterOutput.WriteLine(LocalizableStrings.TemplatePackageCoordinator_lnstall_Info_Success, result.TemplatePackage.DisplayName.Replace("::", "@"));
106+
_reporterOutput.WriteLine(LocalizableStrings.TemplatePackageCoordinator_lnstall_Info_Success, result.TemplatePackage.DisplayName);
107107
TemplateGroupDisplay.DisplayTemplateList(
108108
engineEnvironmentSettings,
109109
templates,
@@ -113,7 +113,7 @@ internal async Task DisplayInstallResultAsync(
113113
}
114114
else
115115
{
116-
_reporterOutput.WriteLine(LocalizableStrings.TemplatePackageCoordinator_lnstall_Warning_No_Templates_In_Package, result.TemplatePackage.DisplayName.Replace("::", "@"));
116+
_reporterOutput.WriteLine(LocalizableStrings.TemplatePackageCoordinator_lnstall_Warning_No_Templates_In_Package, result.TemplatePackage.DisplayName);
117117
}
118118

119119
if (force && result is InstallResult installResult && installResult.Vulnerabilities.Any())

test/dotnet-new.IntegrationTests/Approvals/DotnetNewInstallTests.CanInstallPackageAvailableFromBuiltInsWithForce.verified.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
The following template packages will be installed:
2-
Microsoft.DotNet.Common.ItemTemplates@%VERSION%
2+
Microsoft.DotNet.Common.ItemTemplates::%VERSION%
33

44
Installing the template package(s) will override the available template package(s).
55
The following template package(s) are already available:
66
Microsoft.DotNet.Common.ItemTemplates@%VERSION%
77

8-
Success: Microsoft.DotNet.Common.ItemTemplates@6.0.100 installed the following templates:
8+
Success: Microsoft.DotNet.Common.ItemTemplates::6.0.100 installed the following templates:
99
Template Name Short Name Language Tags
1010
------------------------------- ------------- -------- --------
1111
dotnet gitignore file gitignore Config

test/dotnet-new.IntegrationTests/Approvals/DotnetNewInstallTests.CannotInstallMultiplePackageAvailableFromBuiltIns.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ The following template package(s) are already available:
33
Microsoft.DotNet.Common.ItemTemplates@%VERSION%
44

55
To install the template package(s) anyway, apply '--force' option:
6-
dotnet new install Microsoft.DotNet.Common.ItemTemplates@6.0.100 Microsoft.DotNet.Web.ItemTemplates@5.0.0 --force
6+
dotnet new install Microsoft.DotNet.Common.ItemTemplates::6.0.100 Microsoft.DotNet.Web.ItemTemplates::5.0.0 --force
77

88
For details on the exit code, refer to https://aka.ms/templating-exit-codes#106

test/dotnet-new.IntegrationTests/Approvals/DotnetNewInstallTests.CannotInstallPackageAvailableFromBuiltIns.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ The following template package(s) are already available:
33
Microsoft.DotNet.Common.ItemTemplates@%VERSION%
44

55
To install the template package(s) anyway, apply '--force' option:
6-
dotnet new install Microsoft.DotNet.Common.ItemTemplates@6.0.100 --force
6+
dotnet new install Microsoft.DotNet.Common.ItemTemplates::6.0.100 --force
77

88
For details on the exit code, refer to https://aka.ms/templating-exit-codes#106

test/dotnet-new.IntegrationTests/DotnetNewInstallTests.Approval.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public Task CanInstallPackageAvailableFromBuiltInsWithForce()
4141
return Verify(commandResult.StdOut)
4242
.AddScrubber(output =>
4343
{
44-
output.ScrubByRegex(" Microsoft.DotNet.Common.ItemTemplates@[A-Za-z0-9.-]+", " Microsoft.DotNet.Common.ItemTemplates@%VERSION%");
44+
output.ScrubByRegex(" Microsoft\\.DotNet\\.Common\\.ItemTemplates::[A-Za-z0-9.-]+", " Microsoft.DotNet.Common.ItemTemplates::%VERSION%");
45+
output.ScrubByRegex(" Microsoft\\.DotNet\\.Common\\.ItemTemplates@[A-Za-z0-9.-]+", " Microsoft.DotNet.Common.ItemTemplates@%VERSION%");
4546
});
4647
}
4748

0 commit comments

Comments
 (0)