summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rebar_app_discover.erl2
-rw-r--r--src/rebar_app_utils.erl2
-rw-r--r--src/rebar_erlc_compiler.erl2
-rw-r--r--src/rebar_utils.erl6
4 files changed, 8 insertions, 4 deletions
diff --git a/src/rebar_app_discover.erl b/src/rebar_app_discover.erl
index 19be610..aac8380 100644
--- a/src/rebar_app_discover.erl
+++ b/src/rebar_app_discover.erl
@@ -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
diff --git a/src/rebar_app_utils.erl b/src/rebar_app_utils.erl
index 8544329..1c53743 100644
--- a/src/rebar_app_utils.erl
+++ b/src/rebar_app_utils.erl
@@ -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.
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index 9bebefb..6a16977 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -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)).
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index 18e76fc..fa0a005 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -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,
@@ -77,6 +78,9 @@
%% Public API
%% ====================================================================
+droplast(L) ->
+ lists:reverse(tl(lists:reverse(L))).
+
get_cwd() ->
{ok, Dir} = file:get_cwd(),
Dir.