diff --git a/Wox.Plugin/SharedCommands/FilesFolders.cs b/Wox.Plugin/SharedCommands/FilesFolders.cs index 584a83bc6..f9eb13961 100644 --- a/Wox.Plugin/SharedCommands/FilesFolders.cs +++ b/Wox.Plugin/SharedCommands/FilesFolders.cs @@ -48,7 +48,7 @@ namespace Wox.Plugin.SharedCommands throw e; #else MessageBox.Show(string.Format("Copying path {0} has failed, it will now be deleted for consistency", targetPath)); - RemoveFolder(targetPath); + RemoveFolderIfExists(targetPath); #endif } @@ -81,7 +81,7 @@ namespace Wox.Plugin.SharedCommands } - public static void RemoveFolder(this string path) + public static void RemoveFolderIfExists(this string path) { try { @@ -97,5 +97,15 @@ namespace Wox.Plugin.SharedCommands #endif } } + + public static bool LocationExists(this string path) + { + return Directory.Exists(path); + } + + public static bool FileExits(this string filePath) + { + return File.Exists(filePath); + } } }