mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
22 lines
624 B
C#
22 lines
624 B
C#
using System;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using Flow.Launcher.Plugin.Explorer.Search;
|
|
|
|
namespace Flow.Launcher.Plugin.Explorer.Helper;
|
|
|
|
public static class FolderPathHelper
|
|
{
|
|
public static string GetPathName(this string selectedPath)
|
|
{
|
|
if (string.IsNullOrEmpty(selectedPath)) return "";
|
|
var path = selectedPath.EndsWith(Constants.DirectorySeparator) ? selectedPath[0..^1] : selectedPath;
|
|
|
|
if (path.EndsWith(':'))
|
|
return path[0..^1] + " Drive";
|
|
|
|
return path.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.None)
|
|
.Last();
|
|
}
|
|
|
|
}
|