From 9e9d07877c3d88d431e14a2dd75d4f72672d67c1 Mon Sep 17 00:00:00 2001 From: stavroskasidis Date: Wed, 2 Feb 2022 20:15:38 +0200 Subject: [PATCH] fix existing files exception --- src/BlazorWasmAntivirusProtection.Tasks/ChangeDllHeaders.cs | 2 +- src/BlazorWasmAntivirusProtection.Tasks/RenameDlls.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/BlazorWasmAntivirusProtection.Tasks/ChangeDllHeaders.cs b/src/BlazorWasmAntivirusProtection.Tasks/ChangeDllHeaders.cs index 7f9713a..9488972 100644 --- a/src/BlazorWasmAntivirusProtection.Tasks/ChangeDllHeaders.cs +++ b/src/BlazorWasmAntivirusProtection.Tasks/ChangeDllHeaders.cs @@ -23,7 +23,7 @@ public override bool Execute() if (Path.GetExtension(name) != ".dll") continue; FlipBz(asset.ItemSpec); - Log.LogMessage(MessageImportance.High, $"Changed headers of {asset.ItemSpec}"); + Log.LogMessage(MessageImportance.High, $"Changed header of {asset.ItemSpec}"); } return true; diff --git a/src/BlazorWasmAntivirusProtection.Tasks/RenameDlls.cs b/src/BlazorWasmAntivirusProtection.Tasks/RenameDlls.cs index 7b91ac8..35c2830 100644 --- a/src/BlazorWasmAntivirusProtection.Tasks/RenameDlls.cs +++ b/src/BlazorWasmAntivirusProtection.Tasks/RenameDlls.cs @@ -28,6 +28,7 @@ public override bool Execute() { var newName = file.Replace(".dll", $".{BinaryExtensionName}"); Log.LogMessage(MessageImportance.High, $"Renaming \"{file}\" to \"{newName}\""); + if (File.Exists(newName)) File.Delete(newName); File.Move(file, newName); } }