summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvans163 <vans_163@yahoo.com>2016-09-01 14:44:38 -0400
committervans163 <vans_163@yahoo.com>2016-09-01 14:44:38 -0400
commit6180ce0c64041e58feab600aa71ca31978b5d131 (patch)
treedb6b8b4ef631f34d6adb454534add24eac6057a4
parent9b64c60f8bbbac7686d0f8d1f56219c847d2c811 (diff)
Make less than R17 compatible
-rw-r--r--src/rebar_agent.erl18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/rebar_agent.erl b/src/rebar_agent.erl
index 818401d..6b4526e 100644
--- a/src/rebar_agent.erl
+++ b/src/rebar_agent.erl
@@ -136,13 +136,17 @@ reload_modules(Modules, true) ->
{error, ModRsns} ->
Blacklist =
- (fun Error([], Acc) -> Acc;
- Error([ {ModNif, on_load_not_allowed} |T], Acc) ->
- reload_modules([ModNif], false),
- Error(T, [ModNif|Acc]);
- Error([ {ModError, _} |T], Acc) ->
- Error(T, [ModError|Acc])
- end)(ModRsns, []),
+ lists:foldr(fun({ModError, Error}, Acc) ->
+ case Error of
+ %perhaps cover other cases of failure?
+ on_load_not_allowed ->
+ reload_modules([ModError], false),
+ [ModError|Acc];
+ _ -> [ModError|Acc]
+ end
+ end,
+ [], ModRsns
+ ),
reload_modules(Modules -- Blacklist, true)
end;