From 71d2b88b02ab89422dd23a889e708f4fda29111e Mon Sep 17 00:00:00 2001 From: Robert Muehsig Date: Tue, 15 Jan 2019 20:54:32 +0100 Subject: [PATCH] fix build? --- .../Commands/Actions/DirectoryCopy.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ElectronNET.CLI/Commands/Actions/DirectoryCopy.cs b/ElectronNET.CLI/Commands/Actions/DirectoryCopy.cs index cf0d4a9..39ded69 100644 --- a/ElectronNET.CLI/Commands/Actions/DirectoryCopy.cs +++ b/ElectronNET.CLI/Commands/Actions/DirectoryCopy.cs @@ -23,6 +23,22 @@ namespace ElectronNET.CLI.Commands.Actions { Directory.CreateDirectory(destDirName); } + else + { + DirectoryInfo targetDir = new DirectoryInfo(destDirName); + + foreach (FileInfo fileDel in targetDir.EnumerateFiles()) + { + fileDel.Delete(); + } + foreach (DirectoryInfo dirDel in targetDir.EnumerateDirectories()) + { + dirDel.Delete(true); + } + } + + + // Get the files in the directory and copy them to the new location. FileInfo[] files = dir.GetFiles();