aboutsummaryrefslogtreecommitdiffstats
path: root/src/rcl_prv_discover.erl
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2013-01-05 11:09:18 -0800
committerTristan Sloughter <[email protected]>2013-01-05 11:09:18 -0800
commit1a43e62a5ee0ceafb2082a41e632489b48e7f567 (patch)
tree106c5822d41a2410830b4049993e1a9792e70900 /src/rcl_prv_discover.erl
parented855acb2246aaa05d2fab628e1e09d1082b06a8 (diff)
parentf1632c3282d719cd5cbb46299f4f0557653ba50f (diff)
downloadrelx-1a43e62a5ee0ceafb2082a41e632489b48e7f567.tar.gz
relx-1a43e62a5ee0ceafb2082a41e632489b48e7f567.tar.bz2
relx-1a43e62a5ee0ceafb2082a41e632489b48e7f567.zip
Merge pull request #20 from ericbmerritt/next
overlay directory support
Diffstat (limited to 'src/rcl_prv_discover.erl')
-rw-r--r--src/rcl_prv_discover.erl29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/rcl_prv_discover.erl b/src/rcl_prv_discover.erl
index 0a12d24..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.
- {ok, Cwd} = file:get_cwd(),
-
- RebarConfig = filename:join([Cwd, "rebar.config"]),
- DepsDir = filename:join([Cwd, "deps"]),
- case filelib:is_regular(RebarConfig) andalso filelib:is_dir(DepsDir) of
- true ->
- add_system_lib_dir(State, [filename:absname(Cwd) | 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),