Mojoler.Shell (mojoler v0.1.0)

Copy Markdown View Source

Exit check for Mix tasks that run a shell script.

The task prints the script output. A non-zero status becomes Mix.Error.

Summary

Functions

Writes output and returns nil when status is 0.

Functions

conclude(output, status, label)

@spec conclude(String.t(), integer(), String.t()) :: nil

Writes output and returns nil when status is 0.

label is the script name used in the error. There are no optional arguments.

Raises

Examples

iex> Mojoler.Shell.conclude("ready\n", 0, "doctor")
nil

iex> Mojoler.Shell.conclude("nope\n", 7, "doctor")
** (Mix.Error) doctor failed with status 7