aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlx_prv_app_discover.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rlx_prv_app_discover.erl')
-rw-r--r--src/rlx_prv_app_discover.erl8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rlx_prv_app_discover.erl b/src/rlx_prv_app_discover.erl
index eb40f38..a8a40ae 100644
--- a/src/rlx_prv_app_discover.erl
+++ b/src/rlx_prv_app_discover.erl
@@ -85,6 +85,7 @@ get_lib_dirs(State) ->
lists:flatten([LibDirs0,
add_common_project_dirs(State),
add_system_lib_dir(State),
+ add_environment_lib_dir(State),
OutputDir])
end.
@@ -127,6 +128,13 @@ add_system_lib_dir(State) ->
erlang:iolist_to_binary(SystemLibs)
end.
+-spec add_environment_lib_dir(rlx_state:t()) -> [binary()].
+add_environment_lib_dir(_State) ->
+ case os:getenv("ERL_LIBS") of
+ false -> [];
+ Libs -> [erlang:iolist_to_binary(L) || L <- string:tokens(Libs, ":")]
+ end.
+
%% Order matters so this slow dedup needs to be used
dedup([]) ->
[];