Remove redundant extension check

This commit is contained in:
Vic 2023-01-01 00:24:36 +08:00
parent ff4290c192
commit 3992990ccb

View file

@ -333,26 +333,23 @@ namespace Flow.Launcher.Plugin.Program.Programs
program.LnkResolvedPath = Path.GetFullPath(target);
program.ExecutableName = Path.GetFileName(target);
if (Extension(target) == ExeExtension)
var args = _helper.arguments;
if(!string.IsNullOrEmpty(args))
{
var args = _helper.arguments;
if(!string.IsNullOrEmpty(args))
{
program.LnkResolvedPath += " " + args;
}
program.LnkResolvedPath += " " + args;
}
var description = _helper.description;
if (!string.IsNullOrEmpty(description))
var description = _helper.description;
if (!string.IsNullOrEmpty(description))
{
program.Description = description;
}
else
{
var info = FileVersionInfo.GetVersionInfo(target);
if (!string.IsNullOrEmpty(info.FileDescription))
{
program.Description = description;
}
else
{
var info = FileVersionInfo.GetVersionInfo(target);
if (!string.IsNullOrEmpty(info.FileDescription))
{
program.Description = info.FileDescription;
}
program.Description = info.FileDescription;
}
}
}