Browse Source

Adapt to hex_core's deprecation warnings (II)

pull/2412/head
Paulo F. Oliveira 4 years ago
parent
commit
8390ef348c
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      src/rebar_pkg_resource.erl

+ 2
- 3
src/rebar_pkg_resource.erl View File

@ -29,10 +29,9 @@
-spec init(atom(), rebar_state:t()) -> {ok, rebar_resource_v2:resource()}. -spec init(atom(), rebar_state:t()) -> {ok, rebar_resource_v2:resource()}.
init(Type, State) -> init(Type, State) ->
{ok, Vsn} = application:get_key(rebar, vsn), {ok, Vsn} = application:get_key(rebar, vsn),
BaseConfig = #{http_adapter => r3_hex_http_httpc,
BaseConfig = #{http_adapter => {r3_hex_http_httpc, #{profile => rebar}},
http_user_agent_fragment => http_user_agent_fragment =>
<<"(rebar3/", (list_to_binary(Vsn))/binary, ") (httpc)">>,
http_adapter_config => #{profile => rebar}},
<<"(rebar3/", (list_to_binary(Vsn))/binary, ") (httpc)">>},
Repos = rebar_hex_repos:from_state(BaseConfig, State), Repos = rebar_hex_repos:from_state(BaseConfig, State),
Resource = rebar_resource_v2:new(Type, ?MODULE, #{repos => Repos, Resource = rebar_resource_v2:new(Type, ?MODULE, #{repos => Repos,
base_config => BaseConfig}), base_config => BaseConfig}),

Loading…
Cancel
Save