Deduplicate parsed list of plugin directories

See #3155 for context. It is also possible that someone might
override the path with duplicate values.

Note that the list of directories will lose its original
ordering. That should be fine as we expect unique plugin
paths: it is not a "preference list" (ordering should
not matter).

Closes #3155
This commit is contained in:
Michael Klishin 2021-06-28 17:45:13 +03:00
parent 9a15d787ac
commit d0ad77f10d
No known key found for this signature in database
GPG Key ID: E80EDCFA0CDB21EE
1 changed files with 2 additions and 2 deletions

View File

@ -285,10 +285,10 @@ find_cuttlefish_schemas([], AllSchemas) ->
lists:sort(fun(A,B) -> A < B end, AllSchemas).
list_apps(#{os_type := {win32, _}, plugins_path := PluginsPath}) ->
PluginsDirs = string:lexemes(PluginsPath, ";"),
PluginsDirs = lists:usort(string:lexemes(PluginsPath, ";")),
list_apps1(PluginsDirs, []);
list_apps(#{plugins_path := PluginsPath}) ->
PluginsDirs = string:lexemes(PluginsPath, ":"),
PluginsDirs = lists:usort(string:lexemes(PluginsPath, ":")),
list_apps1(PluginsDirs, []).