Packages

Seekable, compressed terminal recordings for BEAM applications.

Current section

Files

Jump to
ttycast lib mix tasks ttycast.reindex.ex
Raw

lib/mix/tasks/ttycast.reindex.ex

defmodule Mix.Tasks.Ttycast.Reindex do
@moduledoc "Rebuild a ttycast trailer index."
use Mix.Task
@shortdoc "Rebuild .ttycast index"
@impl true
def run([path]) do
case TTYCast.reindex(path) do
{:ok, result} -> Mix.shell().info("reindexed #{result.chunks} chunks in #{result.path}")
{:error, reason} -> Mix.raise("reindex failed: #{inspect(reason)}")
end
end
def run(_argv), do: Mix.raise("usage: mix ttycast.reindex PATH")
end