From 69f66b7a4b6c4beb39a026df409145941cf31738 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Sun, 23 Feb 2020 19:41:24 +1100 Subject: [PATCH] update --- Wox.Plugin/SharedCommands/FilesFolders.cs | 28 +++++++++++++++++------ 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/Wox.Plugin/SharedCommands/FilesFolders.cs b/Wox.Plugin/SharedCommands/FilesFolders.cs index b3f0a3c8b..9576ca7aa 100644 --- a/Wox.Plugin/SharedCommands/FilesFolders.cs +++ b/Wox.Plugin/SharedCommands/FilesFolders.cs @@ -42,16 +42,30 @@ namespace Wox.Plugin.SharedCommands public static bool VerifyBothFolderFilesEqual(this string fromPath, string toPath) { - var fromDir = new DirectoryInfo(fromPath); - var toDir = new DirectoryInfo(toPath); + try + { + var fromDir = new DirectoryInfo(fromPath); + var toDir = new DirectoryInfo(toPath); - if (fromDir.GetFiles().Length != toDir.GetFiles().Length) - return false; + if (fromDir.GetFiles("*", SearchOption.AllDirectories).Length != toDir.GetFiles("*", SearchOption.AllDirectories).Length) + return false; - if (Directory.GetDirectories(fromPath).Length != Directory.GetDirectories(toPath).Length) - return false; + if (fromDir.GetDirectories("*", SearchOption.AllDirectories).Length != toDir.GetDirectories("*", SearchOption.AllDirectories).Length) + return false; + + return true; + } + catch(PathTooLongException e) + { + //log and update error message to output +#if DEBUG + throw; +#else + throw;// PRODUCTION LOGGING AND CONTINUE + +#endif + } - return true; } public static void RemoveFolder(this string path)