diff options
author | Eric <[email protected]> | 2013-01-04 10:33:54 -0500 |
---|---|---|
committer | Eric <[email protected]> | 2013-01-04 10:52:19 -0500 |
commit | 3a5cb6adf215e760068c9d3e7a07eb4f971cabf0 (patch) | |
tree | 718eb042995b56fd2145c0d7a932d1aecd53e0d5 /src/rcl_prv_discover.erl | |
parent | 344fa86b23205eebc3233cf9c69a8e9e145714ac (diff) | |
download | relx-3a5cb6adf215e760068c9d3e7a07eb4f971cabf0.tar.gz relx-3a5cb6adf215e760068c9d3e7a07eb4f971cabf0.tar.bz2 relx-3a5cb6adf215e760068c9d3e7a07eb4f971cabf0.zip |
provide the erlang lib dir and cwd as working libraries
This happens for every call unless the user passes
--disable-default-libs to relcool or {disable_default_libs, true} in
the relcool config.
Diffstat (limited to 'src/rcl_prv_discover.erl')
-rw-r--r-- | src/rcl_prv_discover.erl | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/rcl_prv_discover.erl b/src/rcl_prv_discover.erl index 6ff50ed..4e7ce72 100644 --- a/src/rcl_prv_discover.erl +++ b/src/rcl_prv_discover.erl @@ -112,29 +112,20 @@ setup_overrides(State, AppMetas0) -> get_lib_dirs(State) -> LibDirs0 = rcl_state:lib_dirs(State), - add_rebar_deps_dir(State, LibDirs0). - --spec add_rebar_deps_dir(rcl_state:t(), [file:name()]) -> [file:name()]. -add_rebar_deps_dir(State, LibDirs) -> - ExcludeRebar = rcl_state:get(State, discover_exclude_rebar, false), - case ExcludeRebar of + case rcl_state:get(State, disable_default_libs, false) of true -> - add_system_lib_dir(State, LibDirs); + LibDirs0; false -> - %% Check to see if there is a rebar.config. If so then look for a deps - %% dir. If both are there then we add that to the lib dirs. - Root = rcl_state:root_dir(State), - - RebarConfig = filename:join([Root, "rebar.config"]), - DepsDir = filename:join([Root, "deps"]), - case filelib:is_regular(RebarConfig) andalso filelib:is_dir(DepsDir) of - true -> - add_system_lib_dir(State, [filename:absname(Root) | LibDirs]); - false -> - add_system_lib_dir(State, LibDirs) - end + add_current_dir(State, LibDirs0) end. +-spec add_current_dir(rcl_state:t(), [file:name()]) -> [file:name()]. +add_current_dir(State, LibDirs) -> + %% Check to see if there is a rebar.config. If so then look for a deps + %% dir. If both are there then we add that to the lib dirs. + Root = rcl_state:root_dir(State), + add_system_lib_dir(State, [filename:absname(Root) | LibDirs]). + -spec add_system_lib_dir(rcl_state:t(), [file:name()]) -> [file:name()]. add_system_lib_dir(State, LibDirs) -> ExcludeSystem = rcl_state:get(State, discover_exclude_system, false), |