%% -*- erlang-indent-level: 4; indent-tabs-mode: nil -*-
IsRebar3 = erlang:function_exported(rebar3, main, 1).
case IsRebar3 of
    false ->
	{_, Profs} = lists:keyfind(profiles, 1, CONFIG),
	{_, R2} = lists:keyfind(rebar2, 1, Profs),
	lists:foldl(
	  fun({K,V}, Acc) ->
		  lists:keyreplace(K, 1, Acc, {K, V})
	  end, CONFIG, R2);
    true ->
	CONFIG
end.

