     else
       diff =
         if String.ends_with?(file1, ".beam") do
-          beam_diff(content1, content2)
+          beam_diff(file1, content1, file2, content2)
         else
           file_diff(file1, file2)
         end

  @moduledoc """
  Utilities for comparing build artifacts.
  """

  @tmp_env_vars ~w(TMPDIR TMP TEMP)s

  @known_chunks ~w(
    abstract_code


  defp write_tmp(content) do
    filename = generate_tmp_filename()
    File.mkdir_p!("tmp")
    File.write!(Path.join("tmp", filename), content)
    Path.join("tmp", filename)
  end

  defp generate_tmp_filename do
    sec = :os.system_time(:second)
    rand = :rand.uniform(999_999_999)
    scheduler_id = :erlang.system_info(:scheduler_id)
    "tmp-#{sec}-#{rand}-#{scheduler_id}"
  end
end

