From 6180ce0c64041e58feab600aa71ca31978b5d131 Mon Sep 17 00:00:00 2001 From: vans163 Date: Thu, 1 Sep 2016 14:44:38 -0400 Subject: Make less than R17 compatible --- src/rebar_agent.erl | 18 +++++++++++------- 1 file 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; -- cgit v1.1