ComposerNew.Command (composer_new v0.3.0)

Copy Markdown View Source

One command of a ComposerNew.Plan: an executable and its arguments, run in cd (nil for the current directory). label says which part of the run it is: :create, :install, :record or :run.

Summary

Functions

Quotes arg for a POSIX shell, unless it is made of safe characters only.

Joins arguments into one shell-quoted line.

The command as a shell would take it, each argument quoted when it needs to be, for printing and for retry hints.

Types

label()

@type label() :: :create | :install | :record | :run

t()

@type t() :: %ComposerNew.Command{
  args: [String.t()],
  cd: Path.t() | nil,
  cmd: String.t(),
  label: label()
}

Functions

escape(arg)

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

Quotes arg for a POSIX shell, unless it is made of safe characters only.

join(args)

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

Joins arguments into one shell-quoted line.

to_string(command)

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

The command as a shell would take it, each argument quoted when it needs to be, for printing and for retry hints.