     @echo off
     @escript "%~dpn0" %*
     """)
+
     File.chmod!(path, @escript_file_mode)
   end
+
   defp write_bat!(_path, _type) do
     :ok
   end

      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
