summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2019-10-11 22:46:07 -0400
committerGitHub <noreply@github.com>2019-10-11 22:46:07 -0400
commit41b76f050d636c0f6a12a61715e0a9b50b295fe2 (patch)
tree1640183f61599c571165f806e9a0a382d2ece938
parent8cdf023455bed2601b8bebe807b0c4acfecf5d0d (diff)
parentfefa3bfebb38327706c8c47ddbd5d84d8fb26ef6 (diff)
Merge pull request #2167 from ferd/clear-bootstrap-failuresHEADmaster
Handle missing OTP apps better
-rwxr-xr-xbootstrap19
1 files changed, 15 insertions, 4 deletions
diff --git a/bootstrap b/bootstrap
index 29b7f75..ada49df 100755
--- a/bootstrap
+++ b/bootstrap
@@ -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(),
@@ -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} ->