|
|
|
@ -65,12 +65,12 @@ defmodule Asciinema.PngGenerator.A2png do
|
|
|
|
|
Integer.to_string(png_params.scale)
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
with {:ok, file} <- file_store().open(path),
|
|
|
|
|
{:ok, _} <- :file.copy(file, json_path),
|
|
|
|
|
process <- Porcelain.spawn(bin_path(), args, err: :string),
|
|
|
|
|
{:ok, %{status: 0}} <- Porcelain.Process.await(process, @a2png_timeout) do
|
|
|
|
|
{:ok, png_path}
|
|
|
|
|
else
|
|
|
|
|
{:ok, {:ok, _}} = file_store().open(path, &(:file.copy(&1, json_path)))
|
|
|
|
|
process = Porcelain.spawn(bin_path(), args, err: :string)
|
|
|
|
|
|
|
|
|
|
case Porcelain.Process.await(process, @a2png_timeout) do
|
|
|
|
|
{:ok, %{status: 0}} ->
|
|
|
|
|
{:ok, png_path}
|
|
|
|
|
{:ok, %Porcelain.Result{} = result} ->
|
|
|
|
|
{:error, result}
|
|
|
|
|
otherwise ->
|
|
|
|
|