Skip to content

Commit 0c0f576

Browse files
committed
removing uninstall dotnet templates
1 parent fbb62c8 commit 0c0f576

File tree

1 file changed

+0
-76
lines changed

1 file changed

+0
-76
lines changed

test/Cli/Func.E2E.Tests/Fixtures/BaseFunctionAppFixture.cs

-76
Original file line numberDiff line numberDiff line change
@@ -58,82 +58,6 @@ public BaseFunctionAppFixture(WorkerRuntime workerRuntime, string? targetFramewo
5858

5959
public string? Version { get; set; }
6060

61-
/// <summary>
62-
/// Uninstalls a dotnet template package with the specified name.
63-
/// </summary>
64-
/// <param name="templatePackageName">The name of the template package to uninstall.</param>
65-
/// <returns>True if the uninstallation was successful, false otherwise.</returns>
66-
public bool UninstallDotnetTemplate(string templatePackageName)
67-
{
68-
if (string.IsNullOrEmpty(templatePackageName))
69-
{
70-
throw new ArgumentException("Template package name cannot be null or empty", nameof(templatePackageName));
71-
}
72-
73-
Log.WriteLine($"Uninstalling dotnet template package: {templatePackageName}");
74-
75-
// Create a new process to run the dotnet uninstall command
76-
var process = new Process
77-
{
78-
StartInfo = new ProcessStartInfo
79-
{
80-
FileName = "dotnet",
81-
Arguments = $"new --uninstall {templatePackageName}",
82-
RedirectStandardOutput = true,
83-
RedirectStandardError = true,
84-
UseShellExecute = false,
85-
CreateNoWindow = true,
86-
WorkingDirectory = WorkingDirectory
87-
}
88-
};
89-
90-
var outputBuilder = new StringBuilder();
91-
var errorBuilder = new StringBuilder();
92-
93-
process.OutputDataReceived += (sender, e) =>
94-
{
95-
if (e.Data != null)
96-
{
97-
outputBuilder.AppendLine(e.Data);
98-
Log.WriteLine($"[dotnet template --uninstall] {e.Data}");
99-
}
100-
};
101-
102-
process.ErrorDataReceived += (sender, e) =>
103-
{
104-
if (e.Data != null)
105-
{
106-
errorBuilder.AppendLine(e.Data);
107-
Log.WriteLine($"[dotnet template --uninstall error] {e.Data}");
108-
}
109-
};
110-
111-
try
112-
{
113-
process.Start();
114-
process.BeginOutputReadLine();
115-
process.BeginErrorReadLine();
116-
process.WaitForExit();
117-
118-
var exitCode = process.ExitCode;
119-
120-
if (exitCode != 0)
121-
{
122-
Log.WriteLine($"Failed to uninstall template package '{templatePackageName}'. Exit code: {exitCode}");
123-
Log.WriteLine($"Error: {errorBuilder}");
124-
return false;
125-
}
126-
127-
Log.WriteLine($"Successfully uninstalled template package: {templatePackageName}");
128-
return true;
129-
}
130-
catch (Exception ex)
131-
{
132-
Log.WriteLine($"Exception occurred while uninstalling template package '{templatePackageName}': {ex.Message}");
133-
return false;
134-
}
135-
}
136-
13761
public Task DisposeAsync()
13862
{
13963
try

0 commit comments

Comments
 (0)