This commit is contained in:
Jeremy Wu 2020-02-23 19:41:24 +11:00
parent d55560ea97
commit 69f66b7a4b

View file

@ -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)