Skip to content

Commit

Permalink
Delete temp files after copying them.
Browse files Browse the repository at this point in the history
  • Loading branch information
brutaldev committed Aug 28, 2018
1 parent 8ccb62f commit e6c3332
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Brutal.Dev.StrongNameSigner/SigningHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ public static AssemblyInfo SignAssembly(string assemblyPath, string keyPath, str
{
File.SetAttributes(tempOutputFile, FileAttributes.Normal);
File.Copy(tempOutputFile, outputFile, true);
File.Delete(tempOutputFile);
}

AssemblyInfoCache.TryRemove(assemblyPath, out KeyValuePair<string, AssemblyInfo> _);
Expand Down Expand Up @@ -386,12 +387,14 @@ public static bool FixAssemblyReference(string assemblyPath, string referenceAss
{
File.SetAttributes(tempOutputFileA, FileAttributes.Normal);
File.Copy(tempOutputFileA, assemblyPath, true);
File.Delete(tempOutputFileA);
}

if (File.Exists(tempOutputFileB))
{
File.SetAttributes(tempOutputFileB, FileAttributes.Normal);
File.Copy(tempOutputFileB, referenceAssemblyPath, true);
File.Delete(tempOutputFileB);
}

return fixApplied;
Expand Down Expand Up @@ -474,6 +477,7 @@ public static bool RemoveInvalidFriendAssemblies(string assemblyPath, string key
{
File.SetAttributes(tempOutputFile, FileAttributes.Normal);
File.Copy(tempOutputFile, assemblyPath, true);
File.Delete(tempOutputFile);
}

return fixApplied;
Expand Down

0 comments on commit e6c3332

Please sign in to comment.