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();