Skip to content

Commit

Permalink
fix support for r15
Browse files Browse the repository at this point in the history
  • Loading branch information
tsloughter committed Sep 17, 2014
1 parent 6aaeae9 commit a4d4c6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rebar_app_discover.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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"])),
Expand Down
12 changes: 12 additions & 0 deletions src/rebar_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
-module(rebar_utils).

-export([droplast/1,
filtermap/2,
get_cwd/0,
is_arch/1,
get_arch/0,
Expand Down Expand Up @@ -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 ->
Expand Down

0 comments on commit a4d4c6c

Please sign in to comment.