       # If existing executable was changed,
       # it was overridden
       previous_executable && previous_executable != current_executable ->
-        Mix.shell.error "\nwarning: escript #{inspect executable} overrides executable " <>
-                        "#{inspect previous_executable} already in your PATH\n"
+        Mix.shell().error(
+          "\nwarning: escript #{inspect(executable)} overrides executable " <>
+            "#{inspect(previous_executable)} already in your PATH\n"
+        )
 
       # If existing executable didn't change but it is not the one we installed,
       # it is a conflict
       previous_executable && previous_executable != dst ->
-        Mix.shell.error "\nwarning: escript #{inspect executable} conflicts with executable " <>
-                        "#{inspect previous_executable} already in your PATH\n"
+        Mix.shell().error(
+          "\nwarning: escript #{inspect(executable)} conflicts with executable " <>
+            "#{inspect(previous_executable)} already in your PATH\n"
+        )
 
       # If current executable is nil or does not match the one we just installed,
       # PATH is misconfigured
       current_executable != dst ->
-        Mix.shell.error "\nwarning: you must append #{inspect Mix.Local.path_for(:escript)} " <>
-                        "to your PATH if you want to invoke escripts by name\n"
+        Mix.shell().error(
+          "\nwarning: you must append #{inspect(Mix.Local.path_for(:escript))} " <>
+            "to your PATH if you want to invoke escripts by name\n"
+        )
 
       true ->
         :ok

      File.mkdir_p!(Path.dirname(dst))
      File.write!(dst, binary)
      File.chmod!(dst, @escript_file_mode)
      write_bat!(dst <> ".bat", :os.type)

      Mix.shell.info [:green, "* creating ", :reset, Path.relative_to_cwd(dst)]
      check_discoverability(dst, executable, previous_executable)
      :ok
    else
      Mix.raise "The given path does not point to an escript, installation aborted"
    end
  end

  def build(_spec, _opts) do
    Mix.Task.run("escript.build", [])
    Mix.Local.name_for(:escript, Mix.Project.config)
  end

  # Helpers


  @behaviour Mix.Local.Installer

  # only read and execute permissions
  @escript_file_mode 0o555
  @switches [force: :boolean, sha512: :string, submodules: :boolean, app: :string]

  def run(argv) do
