     cond do
       not Code.ensure_loaded?(Hex) ->
         false
-      not Version.match?(Hex.version, @hex_requirement) ->
-        Mix.shell.info "Mix requires Hex #{@hex_requirement} but you have #{Hex.version}"
 
-        if Mix.shell.yes?("Shall I abort the current command and update Hex?") do
-          Mix.Tasks.Local.Hex.run ["--force"]
+      not Version.match?(Hex.version(), @hex_requirement) ->
+        Mix.shell().info("Mix requires Hex #{@hex_requirement} but you have #{Hex.version()}")
+
+        if Mix.shell().yes?("Shall I abort the current command and update Hex?") do
+          Mix.Tasks.Local.Hex.run(["--force"])
           exit({:shutdown, 0})
         end
 
         false
+
       true ->
         true
     end

  """
  def start do
    try do
      Hex.start
    catch
      kind, reason ->
        stacktrace = System.stacktrace
        Mix.shell.error "Could not start Hex. Try fetching a new version with " <>
                        "\"mix local.hex\" or uninstalling it with \"mix archive.uninstall hex.ez\""
        :erlang.raise(kind, reason, stacktrace)
    end
  end

defmodule Mix.Hex do
  @moduledoc false
  @hex_requirement ">= 0.14.0"
  @hex_mirror "https://repo.hex.pm"

  @doc """
  Returns `true` if `Hex` is loaded or installed. Otherwise returns `false`.
