mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Update getting previous directory method
This commit is contained in:
parent
355a787b5e
commit
3caafa325f
1 changed files with 3 additions and 3 deletions
|
|
@ -164,16 +164,16 @@ namespace Flow.Launcher.Plugin.SharedCommands
|
|||
///<summary>
|
||||
/// Gets the previous level directory from a path string.
|
||||
/// Checks that previous level directory exists and returns it
|
||||
/// as a path string, or empty string if doesnt exit
|
||||
/// as a path string, or empty string if doesn't exit
|
||||
///</summary>
|
||||
public static string GetPreviousExistingDirectory(Func<string, bool> locationExists, string path)
|
||||
{
|
||||
var previousDirectoryPath = "";
|
||||
int index = path.LastIndexOf('\\');
|
||||
var index = path.LastIndexOf('\\');
|
||||
if (index > 0 && index < (path.Length - 1))
|
||||
{
|
||||
previousDirectoryPath = path.Substring(0, index + 1);
|
||||
if (!locationExists(path))
|
||||
if (!locationExists(previousDirectoryPath))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue