ComposerNew.Shell (composer_new v0.3.0)

Copy Markdown View Source

Prints a ComposerNew.Plan, or runs it.

Each command is its own OS process, with its output streamed to the terminal. A child's stdin isn't a terminal, so a prompt would hang: every mix command in the plan gets --yes.

Summary

Functions

A plan step as a shell line, with the directory it runs in.

Prints the plan's summary and its numbered commands.

Runs the plan's commands in order, stopping at the first that fails. Returns :ok or {:error, command, status}.

Functions

describe(command)

@spec describe(ComposerNew.Plan.step()) :: String.t()

A plan step as a shell line, with the directory it runs in.

print(plan)

@spec print(ComposerNew.Plan.t()) :: :ok

Prints the plan's summary and its numbered commands.

run(plan)

@spec run(ComposerNew.Plan.t()) ::
  :ok | {:error, ComposerNew.Command.t(), non_neg_integer()}

Runs the plan's commands in order, stopping at the first that fails. Returns :ok or {:error, command, status}.