diff options
author | Alexey Romanov <alexey.v.romanov@gmail.com> | 2011-03-05 14:11:31 +0300 |
---|---|---|
committer | Alexey Romanov <alexey.v.romanov@gmail.com> | 2011-03-05 14:11:31 +0300 |
commit | 7c40d624dc344e534c7b576341463648091f56e8 (patch) | |
tree | 4b384980bd6fe327cdecf25c55a6dd2622cd8412 /src/rebar_core.erl | |
parent | 48d23b90acb688a68354b20a1b19fa0aa0e592be (diff) | |
parent | 25c0226ab94560c5e182944c4c71b9f71ac3f08e (diff) |
Merge commit 'upstream/master'
Diffstat (limited to 'src/rebar_core.erl')
-rw-r--r-- | src/rebar_core.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rebar_core.erl b/src/rebar_core.erl index db3e0b4..d92af34 100644 --- a/src/rebar_core.erl +++ b/src/rebar_core.erl @@ -76,6 +76,10 @@ process_commands([Command | Rest]) -> lists:foreach(fun (D) -> erlang:erase({skip_dir, D}) end, skip_dirs()), Operations = erlang:get(operations), + %% Convert the code path so that all the entries are absolute paths. + %% If not, code:set_path() may choke on invalid relative paths when trying + %% to restore the code path from inside a subdirectory. + true = rebar_utils:expand_code_path(), _ = process_dir(rebar_utils:get_cwd(), rebar_config:new(), Command, sets:new()), case erlang:get(operations) of @@ -280,8 +284,8 @@ expand_lib_dirs([Dir | Rest], Root, Acc) -> select_modules([], _Command, Acc) -> lists:reverse(Acc); select_modules([Module | Rest], Command, Acc) -> - Exports = Module:module_info(exports), - case lists:member({Command, 2}, Exports) of + {module, Module} = code:ensure_loaded(Module), + case erlang:function_exported(Module, Command, 2) of true -> select_modules(Rest, Command, [Module | Acc]); false -> |