summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2014-09-17 18:28:44 -0500
committerTristan Sloughter <t@crashfast.com>2014-09-17 18:28:44 -0500
commita4d4c6ca63928402363fe3fcbd2b1b615a3b7e42 (patch)
tree40e81f1cd55bf7a309c238105c9dbab02b66d308 /src
parent6aaeae93eae0581e1b0a8222ca28f4117d9b9bf5 (diff)
fix support for r15
Diffstat (limited to 'src')
-rw-r--r--src/rebar_app_discover.erl6
-rw-r--r--src/rebar_utils.erl12
2 files changed, 15 insertions, 3 deletions
diff --git a/src/rebar_app_discover.erl b/src/rebar_app_discover.erl
index aac8380..c90a8df 100644
--- a/src/rebar_app_discover.erl
+++ b/src/rebar_app_discover.erl
@@ -51,9 +51,9 @@ find_apps(LibDirs) ->
find_apps(LibDirs, valid).
find_apps(LibDirs, Validate) ->
- lists:filtermap(fun(AppDir) ->
- find_app(AppDir, Validate)
- end, all_app_dirs(LibDirs)).
+ rebar_utils:filtermap(fun(AppDir) ->
+ find_app(AppDir, Validate)
+ end, all_app_dirs(LibDirs)).
find_app(AppDir, Validate) ->
AppFile = filelib:wildcard(filename:join([AppDir, "ebin", "*.app"])),
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index fa0a005..b83c03e 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -27,6 +27,7 @@
-module(rebar_utils).
-export([droplast/1,
+ filtermap/2,
get_cwd/0,
is_arch/1,
get_arch/0,
@@ -85,6 +86,17 @@ get_cwd() ->
{ok, Dir} = file:get_cwd(),
Dir.
+filtermap(F, [Hd|Tail]) ->
+ case F(Hd) of
+ true ->
+ [Hd|filtermap(F, Tail)];
+ {true,Val} ->
+ [Val|filtermap(F, Tail)];
+ false ->
+ filtermap(F, Tail)
+ end;
+filtermap(F, []) when is_function(F, 1) -> [].
+
is_arch(ArchRegex) ->
case re:run(get_arch(), ArchRegex, [{capture, none}]) of
match ->