tool_run
tool_run
#
run_tool — subprocess.run for a recipe: the child's output streams into the log.
The command is a log scope; both of the child's streams are pumped, as they
arrive, into the live directory's exec.log and into one tail entry
beneath the scope holding the last lines, so a page or terminal shows what the
tool is saying. Only a capturing caller's streams are also buffered. With no
log to write the call is a plain subprocess.run under the same scope.
run_tool(argv, *, cwd, env, timeout, check, capture_output, log)
#
Run argv in cwd the way subprocess.run does, streaming its output to log.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
argv
|
Sequence[str | PathLike[str]]
|
The command line. |
required |
cwd
|
PathLike[str]
|
The working directory. |
required |
env
|
Mapping[str, str] | None
|
The child's environment, or the parent's when |
required |
timeout
|
float | None
|
Seconds before the child is killed. |
required |
check
|
bool
|
Whether a non-zero exit raises. |
required |
capture_output
|
bool
|
Whether stdout and stderr come back on the result. |
required |
log
|
Path | None
|
The |
required |
Raises:
| Type | Description |
|---|---|
CalledProcessError
|
If |
TimeoutExpired
|
If the child outlives |