Skip to content

Commit

Permalink
remove use of 17+ function lists:droplast/1
Browse files Browse the repository at this point in the history
  • Loading branch information
tsloughter committed Sep 17, 2014
1 parent 0bd8ecd commit 6aaeae9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/rebar_app_discover.erl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ find_app(AppDir, Validate) ->
end.

app_dir(AppFile) ->
filename:join(lists:droplast(filename:split(filename:dirname(AppFile)))).
filename:join(rebar_utils:droplast(filename:split(filename:dirname(AppFile)))).

create_app_info(AppDir, AppFile) ->
case file:consult(AppFile) of
Expand Down
2 changes: 1 addition & 1 deletion src/rebar_app_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ is_app_src(Filename) ->
Filename =/= filename:rootname(Filename, ".app.src").

app_src_to_app(Filename) ->
Path = filename:join(lists:droplast(filename:split(filename:dirname(Filename)))),
Path = filename:join(rebar_utils:droplast(filename:split(filename:dirname(Filename)))),
AppFile = filename:join([Path, "ebin", filename:basename(Filename, ".app.src") ++ ".app"]),
filelib:ensure_dir(AppFile),
AppFile.
Expand Down
2 changes: 1 addition & 1 deletion src/rebar_erlc_compiler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ u_add_element(Elem, []) -> [Elem].
rebar_state:t()) -> [file:filename(), ...].
include_path(Source, Config) ->
ErlOpts = rebar_state:get(Config, erl_opts, []),
Dir = filename:join(lists:droplast(filename:split(filename:dirname(Source)))),
Dir = filename:join(rebar_utils:droplast(filename:split(filename:dirname(Source)))),
lists:usort([filename:join(Dir, "include"), filename:dirname(Source)]
++ proplists:get_all_values(i, ErlOpts)).

Expand Down
6 changes: 5 additions & 1 deletion src/rebar_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
%% -------------------------------------------------------------------
-module(rebar_utils).

-export([get_cwd/0,
-export([droplast/1,
get_cwd/0,
is_arch/1,
get_arch/0,
wordsize/0,
Expand Down Expand Up @@ -77,6 +78,9 @@
%% Public API
%% ====================================================================

droplast(L) ->
lists:reverse(tl(lists:reverse(L))).

get_cwd() ->
{ok, Dir} = file:get_cwd(),
Dir.
Expand Down

0 comments on commit 6aaeae9

Please sign in to comment.