File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -284,14 +284,23 @@ defmodule Mix.Tasks.Escript.Build do
284284
285285 defp main_body_for ( :elixir ) do
286286 quote do
287+ erl_version = :erlang . system_info ( :otp_release )
288+ case :string . to_integer ( erl_version ) do
289+ { num , _ } when is_integer ( num ) and num >= 17 -> nil
290+ _ ->
291+ io_error [ "Incompatible Erlang/OTP release: " , erl_version ,
292+ ".\n This escript requires at least Erlang/OTP 17.0.\n " ]
293+ :erlang . halt ( 1 )
294+ end
295+
287296 case :application . ensure_all_started ( :elixir ) do
288297 { :ok , _ } ->
289298 load_config ( @ config )
290299 start_app ( @ app )
291300 args = Enum . map ( args , & List . to_string ( & 1 ) )
292301 Kernel.CLI . run fn _ -> @ module . main ( args ) end , true
293- _ ->
294- :io . put_chars :standard_error , "Elixir is not available, aborting .\n "
302+ error ->
303+ io_error [ "Failed to start Elixir .\n ", :io_lib . format ( 'error: ~p~n' , [ error ] ) ]
295304 :erlang . halt ( 1 )
296305 end
297306 end
You can’t perform that action at this time.
0 commit comments