Drop-in replacement for System.cmd/3 that streams the spawned process's
combined stdout/stderr to :stdio as each chunk arrives, while still
accumulating the full output for the caller.
Return shape matches System.cmd/3 — {output, exit_status} — so call
sites can keep using the existing {out, 0} / {out, code} patterns.
Options
:env— env vars as a list of{key, value}string tuples, same asSystem.cmd/3.:stream— explicit override of the streaming behaviour. When omitted, falls back toApplication.get_env(:git_hoox, :stream_output, true). Tests set the application env tofalseintest/test_helper.exsso they keep clean output; realmix git_hoox.runinvocations stream by default.:device— IO device to write streamed chunks to. Default:stdio. Useful for redirecting to:stderror to a captured device in tests.
Hook timeouts are still enforced one layer up by
GitHoox.Runner. When the runner brutally kills the Task that owns the
port, BEAM closes the port and the OS child process gets SIGTERM.
Summary
Functions
Run command with args, returning {output, exit_status}.
Types
Functions
@spec run(String.t(), [String.t()], cmd_opts()) :: {String.t(), non_neg_integer()}
Run command with args, returning {output, exit_status}.
If command cannot be resolved on $PATH, returns
{"git_hoox: executable not found: <command> ", 127} so callers can
keep the standard {out, code} match shape. 127 is the POSIX
command-not-found exit code.