aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2015-04-06 09:40:26 -0500
committerTristan Sloughter <[email protected]>2015-04-06 09:40:26 -0500
commitf9c074798872d119b603dd977a946f6ad1021ba0 (patch)
tree5d6210e81647d54409b4abfff8b14b4b31ef28a5
parentadc9ab5decde88870abbe195f1685da23bdf1016 (diff)
parentadfd83ab609fb36ef1bca57e5c8821f71476b3a4 (diff)
downloadrelx-f9c074798872d119b603dd977a946f6ad1021ba0.tar.gz
relx-f9c074798872d119b603dd977a946f6ad1021ba0.tar.bz2
relx-f9c074798872d119b603dd977a946f6ad1021ba0.zip
Merge pull request #328 from surik/master
Add ERL_LIBS environment
-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([]) ->
[];