aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--src/rlx_prv_app_discover.erl8
2 files changed, 8 insertions, 2 deletions
diff --git a/README.md b/README.md
index 9e7217c..645a432 100644
--- a/README.md
+++ b/README.md
@@ -67,7 +67,7 @@ Options
| Short | Long | Type | Default | Description |
|:-----:|:------------:|:-------:|:------:|------------------------------------------------------------------------------------------- |
| -r | --root | string | ./ | Sets the root of the project |
-| -n | --name | string | | Name for the release that will be generated |
+| -n | --relname | string | | Name for the release that will be generated |
| -v | --relvsn | string | | Version for the release |
| -g | --goal | string | | A goal for the system. These are usually the OTP apps that are part of the release |
| -u | --upfrom | string | | The release to upgrade from. Only valid with relup target |
diff --git a/src/rlx_prv_app_discover.erl b/src/rlx_prv_app_discover.erl
index 9a5da4d..b5226ad 100644
--- a/src/rlx_prv_app_discover.erl
+++ b/src/rlx_prv_app_discover.erl
@@ -55,7 +55,7 @@ init(State) ->
%% looking for OTP Applications
-spec do(rlx_state:t()) -> {ok, rlx_state:t()} | relx:error().
do(State0) ->
- LibDirs = lists:usort(get_lib_dirs(State0)),
+ LibDirs = dedup(get_lib_dirs(State0)),
case rlx_app_discovery:do(State0, LibDirs) of
{ok, AppMeta} ->
State1 = rlx_state:available_apps(State0, AppMeta),
@@ -131,3 +131,9 @@ add_system_lib_dir(State) ->
SystemLibs ->
erlang:iolist_to_binary(SystemLibs)
end.
+
+%% Order matters so this slow dedup needs to be used
+dedup([]) ->
+ [];
+dedup([H|T]) ->
+ [H | [X || X <- dedup(T), X /= H]].