Make template package uninstallation detection report errors properly

This commit is contained in:
Steve Sanderson 2017-09-11 18:13:15 +01:00
parent cb500fe3b8
commit 148e4af837
1 changed files with 11 additions and 15 deletions

View File

@ -74,8 +74,7 @@ namespace Templates.Test.Helpers
// Verify we really did remove the previous templates // Verify we really did remove the previous templates
var tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("D")); var tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("D"));
Directory.CreateDirectory(tempDir); Directory.CreateDirectory(tempDir);
try
{
var proc = ProcessEx.Run( var proc = ProcessEx.Run(
output, output,
tempDir, tempDir,
@ -86,12 +85,9 @@ namespace Templates.Test.Helpers
{ {
throw new InvalidOperationException($"Failed to uninstall previous templates. The template '{templateName}' could still be found."); throw new InvalidOperationException($"Failed to uninstall previous templates. The template '{templateName}' could still be found.");
} }
}
finally
{
Directory.Delete(tempDir); Directory.Delete(tempDir);
} }
}
private static string FindAncestorDirectoryContaining(string filename) private static string FindAncestorDirectoryContaining(string filename)
{ {