From f7a6459a9da9ec72b25602eca48a03e6b6202ef2 Mon Sep 17 00:00:00 2001 From: Mark Downie Date: Thu, 25 Feb 2021 23:37:49 -0500 Subject: [PATCH] Check if the file exists before attempting to save it. --- source/DasBlog.CLI/InitializeConfigFiles.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/DasBlog.CLI/InitializeConfigFiles.cs b/source/DasBlog.CLI/InitializeConfigFiles.cs index 2ad668b7..bbe05a3c 100644 --- a/source/DasBlog.CLI/InitializeConfigFiles.cs +++ b/source/DasBlog.CLI/InitializeConfigFiles.cs @@ -22,8 +22,11 @@ public static void CopyFiles(string source, string environment) foreach (var file in files) { var renamefile = file.Name.Replace(".", $".{environment}."); - - file.CopyTo(Path.Combine(dir.FullName, renamefile), false); + + if (!File.Exists(Path.Combine(dir.FullName, renamefile))) + { + file.CopyTo(Path.Combine(dir.FullName, renamefile), false); + } } }