Skip to content

Commit 0635ebd

Browse files
Disable recursive search for PATH folders
1 parent efd1b6c commit 0635ebd

File tree

1 file changed

+3
-3
lines changed
  • Plugins/Flow.Launcher.Plugin.Program/Programs

1 file changed

+3
-3
lines changed

Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,14 @@ private static Win32 ExeProgram(string path)
318318
}
319319
}
320320

321-
private static IEnumerable<string> ProgramPaths(string directory, string[] suffixes)
321+
private static IEnumerable<string> ProgramPaths(string directory, string[] suffixes, bool recursive=true)
322322
{
323323
if (!Directory.Exists(directory))
324324
return Enumerable.Empty<string>();
325325

326326
return Directory.EnumerateFiles(directory, "*", new EnumerationOptions
327327
{
328-
IgnoreInaccessible = true, RecurseSubdirectories = true
328+
IgnoreInaccessible = true, RecurseSubdirectories = recursive
329329
}).Where(x => suffixes.Contains(Extension(x)));
330330
}
331331

@@ -393,7 +393,7 @@ private static IEnumerable<Win32> PATHPrograms(string[] suffixes)
393393

394394
foreach (var path in paths)
395395
{
396-
var p = ProgramPaths(path, suffixes);
396+
var p = ProgramPaths(path, suffixes, recursive:false);
397397
toFilter.AddRange(p);
398398
}
399399
var programs = ExceptDisabledSource(toFilter.Distinct())

0 commit comments

Comments
 (0)