Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed issue 213 - tell user to install proper erlang version if crypt…

…o module not present
  • Loading branch information...
commit df244c5d9d5e01aef3eedbb130941e8c69141f69 1 parent dfb1fd4
Edward Wang authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 src/agner.erl
View
18 src/agner.erl
@@ -28,6 +28,7 @@ start() ->
[_|_] ->
ignore
end,
+ ensure_crypto_loaded(),
filelib:ensure_dir(os:getenv("AGNER_EXACT_PREFIX") ++ "/"),
inets:start(),
ssl:start(),
@@ -104,3 +105,20 @@ fetch(Name, Version, Directory) ->
versions(Name) ->
agner_server:versions(Name).
+
+
+%%%===================================================================
+%%% private
+%%%===================================================================
+ensure_crypto_loaded() ->
+ case code:load_file(crypto) of
+ {module, crypto} ->
+ ignore;
+ {error, _Err} ->
+ [io:format("~s~n", [Msg])
+ || Msg <- ["Your local Erlang installation doesn't include the crypto module",
+ "Make sure you have erlang-crypto and erlang-dev if on Debian",
+ " have erlang-crypto and erlang-devel if on Redhat/Fedora",
+ " sudo port install erlang +ssl if on OS X",
+ "Or, let kerl (https://github.com/evax/kerl) take care of those for you"]]
+ end.
Please sign in to comment.
Something went wrong with that request. Please try again.