Skip to content

Commit 360f705

Browse files
committed
Skip uninstall step
1 parent 75330a1 commit 360f705

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/ProjectTemplates/Shared/TemplatePackageInstaller.cs

+17-11
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,23 @@ NUnit 3 Test Item (nunit-test) VB
120120
121121
* We don't want to construct this path so we'll rely on dotnet new --uninstall --help to construct the uninstall command.
122122
*/
123+
// Workaround for https://github.com/dotnet/sdk/issues/16906
124+
// await UninstallExistingTemplatesAsync(output);
125+
126+
foreach (var packagePath in builtPackages)
127+
{
128+
output.WriteLine($"Installing templates package {packagePath}...");
129+
var result = await RunDotNetNew(output, $"--install \"{packagePath}\"");
130+
Assert.True(result.ExitCode == 0, result.GetFormattedOutput());
131+
}
132+
133+
await VerifyCanFindTemplate(output, "webapp");
134+
await VerifyCanFindTemplate(output, "web");
135+
await VerifyCanFindTemplate(output, "react");
136+
}
137+
138+
private static async Task UninstallExistingTemplatesAsync(ITestOutputHelper output)
139+
{
123140
var proc = await RunDotNetNew(output, "--uninstall --help");
124141
var lines = proc.Output.Split(Environment.NewLine);
125142

@@ -145,17 +162,6 @@ NUnit 3 Test Item (nunit-test) VB
145162
await VerifyCannotFindTemplateAsync(output, "react");
146163
await VerifyCannotFindTemplateAsync(output, "reactredux");
147164
await VerifyCannotFindTemplateAsync(output, "angular");
148-
149-
foreach (var packagePath in builtPackages)
150-
{
151-
output.WriteLine($"Installing templates package {packagePath}...");
152-
var result = await RunDotNetNew(output, $"--install \"{packagePath}\"");
153-
Assert.True(result.ExitCode == 0, result.GetFormattedOutput());
154-
}
155-
156-
await VerifyCanFindTemplate(output, "webapp");
157-
await VerifyCanFindTemplate(output, "web");
158-
await VerifyCanFindTemplate(output, "react");
159165
}
160166

161167
private static async Task VerifyCanFindTemplate(ITestOutputHelper output, string templateName)

0 commit comments

Comments
 (0)