Bsdkrun.Types.Result (bsdkrun_ex v0.1.0)

Copy Markdown View Source

The captured result of running a command in the guest (Bsdkrun.Sandbox.exec/3).

Summary

Functions

Parse stdout as JSON.

Non-empty stdout lines.

Whether the command succeeded (exit 0).

stdout with trailing newlines trimmed — the common case.

Types

t()

@type t() :: %Bsdkrun.Types.Result{
  command: String.t(),
  exit_code: integer(),
  stderr: String.t(),
  stdout: String.t()
}

Functions

json(result)

@spec json(t()) :: term()

Parse stdout as JSON.

lines(result)

@spec lines(t()) :: [String.t()]

Non-empty stdout lines.

ok?(result)

@spec ok?(t()) :: boolean()

Whether the command succeeded (exit 0).

text(result)

@spec text(t()) :: String.t()

stdout with trailing newlines trimmed — the common case.