Skip to content

Commit

Permalink
Re-use rebar_utils:ebin_dir()
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuncer Ayaz authored and efine committed Aug 6, 2012
1 parent 7f98192 commit 8dc502b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
5 changes: 1 addition & 4 deletions src/rebar_edoc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,9 @@ setup_code_path() ->
%% and the like can work properly when generating their own
%% documentation.
CodePath = code:get_path(),
true = code:add_patha(ebin_dir()),
true = code:add_patha(rebar_utils:ebin_dir()),
CodePath.

ebin_dir() ->
filename:join(rebar_utils:get_cwd(), "ebin").

-spec file_modified_since(Filename::string(),
SinceTime::non_neg_integer()) -> true | no_return().
file_modified_since(Filename, SinceTime) ->
Expand Down
2 changes: 1 addition & 1 deletion src/rebar_erlydtl_compiler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
compile(Config, _AppFile) ->
DtlOpts = erlydtl_opts(Config),
OrigPath = code:get_path(),
true = code:add_path(filename:join(rebar_utils:get_cwd(), "ebin")),
true = code:add_path(rebar_utils:ebin_dir()),
Result = rebar_base_compiler:run(Config, [],
option(doc_root, DtlOpts),
option(source_ext, DtlOpts),
Expand Down
5 changes: 1 addition & 4 deletions src/rebar_shell.erl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ shell(_Config, _AppFile) ->
%% for the "top level" directory
case is_deps_dir(rebar_utils:get_cwd()) of
false ->
true = code:add_pathz(ebin_dir()),
true = code:add_pathz(rebar_utils:ebin_dir()),
user_drv:start(),
%% this call never returns (until user quits shell)
shell:server(false, false);
Expand All @@ -47,9 +47,6 @@ shell(_Config, _AppFile) ->
end,
ok.

ebin_dir() ->
filename:join(rebar_utils:get_cwd(), "ebin").

is_deps_dir(Dir) ->
case lists:reverse(filename:split(Dir)) of
[_, "deps" | _] ->
Expand Down
2 changes: 1 addition & 1 deletion src/rebar_xref.erl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ xref(Config, _) ->

%% Save the code path prior to doing anything
OrigPath = code:get_path(),
true = code:add_path(filename:join(rebar_utils:get_cwd(), "ebin")),
true = code:add_path(rebar_utils:ebin_dir()),

%% Get list of xref checks we want to run
XrefChecks = rebar_config:get(Config, xref_checks,
Expand Down

0 comments on commit 8dc502b

Please sign in to comment.