Skip to content

Commit

Permalink
Merge pull request #2167 from ferd/clear-bootstrap-failures
Browse files Browse the repository at this point in the history
Handle missing OTP apps better
  • Loading branch information
ferd authored Oct 12, 2019
2 parents 8cdf023 + fefa3bf commit 41b76f0
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
%% ex: ft=erlang ts=4 sw=4 et

main(_) ->
application:start(crypto),
application:start(asn1),
application:start(public_key),
application:start(ssl),
ensure_app(crypto),
ensure_app(asn1),
ensure_app(public_key),
ensure_app(ssl),
inets:start(),
inets:start(httpc, [{profile, rebar}]),
set_httpc_options(),
Expand Down Expand Up @@ -57,6 +57,17 @@ main(_) ->
%% Done with compile, can turn back on error logger
error_logger:tty(true).

ensure_app(App) ->
case application:start(App) of
ok ->
ok;
{error, _} ->
io:format("OTP Application ~p not available. Please fix "
"your Erlang install to support it and try "
"again.~n", [App]),
halt(1)
end.

fetch_and_compile({Name, ErlFirstFiles}, Deps) ->
case lists:keyfind(Name, 1, Deps) of
{Name, Vsn} ->
Expand Down

0 comments on commit 41b76f0

Please sign in to comment.