diff options
author | Tristan Sloughter <t@crashfast.com> | 2015-05-21 19:34:09 -0500 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2015-05-21 19:37:04 -0500 |
commit | fdc1267f6759d27b5874b430be5a74d1f2c47ce1 (patch) | |
tree | 0e477947d40f09c42b60522ba2ca4c6f47d0e52e | |
parent | 0bd49634ce58fcc4bcef1838604cb9a548192ad9 (diff) |
start httpc in run/1 so it is available to download global plugins
-rw-r--r-- | src/rebar3.erl | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl index 2e4018f..8fe6224 100644 --- a/src/rebar3.erl +++ b/src/rebar3.erl @@ -56,7 +56,7 @@ main(Args) -> %% Erlang-API entry point run(BaseState, Commands) -> - _ = application:load(rebar), + start_and_load_apps(), BaseState1 = rebar_state:set(BaseState, task, Commands), BaseState2 = rebar_state:set(BaseState1, caller, api), run_aux(BaseState2, Commands). @@ -66,7 +66,7 @@ run(BaseState, Commands) -> %% ==================================================================== run(RawArgs) -> - _ = application:load(rebar), + start_and_load_apps(), BaseState = init_config(), BaseState1 = rebar_state:set(BaseState, caller, command_line), @@ -83,16 +83,6 @@ run(RawArgs) -> run_aux(BaseState2, RawArgs). run_aux(State, RawArgs) -> - %% Make sure crypto is running - case crypto:start() of - ok -> ok; - {error,{already_started,crypto}} -> ok - end, - application:start(asn1), - application:start(public_key), - application:start(ssl), - inets:start(), - State2 = case os:getenv("REBAR_PROFILE") of false -> State; @@ -266,3 +256,15 @@ handle_error(Error) -> ?DEBUG("Uncaught error: ~p", [Error]), ?INFO("When submitting a bug report, please include the output of `rebar3 report \"your command\"`", []), erlang:halt(1). + +start_and_load_apps() -> + _ = application:load(rebar), + %% Make sure crypto is running + case crypto:start() of + ok -> ok; + {error,{already_started,crypto}} -> ok + end, + application:start(asn1), + application:start(public_key), + application:start(ssl), + inets:start(). |