aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYury Gargay <[email protected]>2015-04-03 17:29:49 +0600
committerYury Gargay <[email protected]>2015-04-06 11:13:02 +0600
commitadfd83ab609fb36ef1bca57e5c8821f71476b3a4 (patch)
tree5d6210e81647d54409b4abfff8b14b4b31ef28a5 /src
parentadc9ab5decde88870abbe195f1685da23bdf1016 (diff)
downloadrelx-adfd83ab609fb36ef1bca57e5c8821f71476b3a4.tar.gz
relx-adfd83ab609fb36ef1bca57e5c8821f71476b3a4.tar.bz2
relx-adfd83ab609fb36ef1bca57e5c8821f71476b3a4.zip
Add ERL_LIBS environment
Diffstat (limited to 'src')
-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([]) ->
[];