Merge pull request #1551 from VictoriousRaptor/ProgramIndexPATH

Fix #1546
This commit is contained in:
VictoriousRaptor 2022-11-18 14:19:39 +08:00 committed by GitHub
commit c2f5e5b3f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -447,9 +447,9 @@ namespace Flow.Launcher.Plugin.Program.Programs
var paths = pathEnv.Split(";", StringSplitOptions.RemoveEmptyEntries).DistinctBy(p => p.ToLowerInvariant());
paths = paths.Where(x => commonParents.All(parent => !x.StartsWith(parent, StringComparison.OrdinalIgnoreCase)));
var toFilter = paths.AsParallel().SelectMany(p => EnumerateProgramsInDir(p, suffixes, recursive: false));
var toFilter = paths.Where(x => commonParents.All(parent => !IsSubPathOf(x, parent)))
.AsParallel()
.SelectMany(p => EnumerateProgramsInDir(p, suffixes, recursive: false));
var programs = ExceptDisabledSource(toFilter.Distinct())
.Select(x => GetProgramFromPath(x, protocols));