Change method name to make intention clearer. Add additional methods

This commit is contained in:
Jeremy Wu 2020-03-05 23:10:16 +11:00
parent dbc52f56c8
commit 39eac96023

View file

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