Tools¶
tools
¶
Low-level runtime utilities: subprocess execution and shell script runners.
Sections
- Subprocess: wrappers around subprocess.run and shell script execution
Functions:
| Name | Description |
|---|---|
run |
Run a subprocess command and optionally capture its output. |
run
¶
run(cmd: list, check: bool = True, capture: bool = False, cwd: Optional[str] = None, name: Optional[str] = None) -> Optional[str]
Run a subprocess command and optionally capture its output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list
|
Command and arguments to execute. |
required |
|
bool
|
If True, raise CalledProcessError on non-zero exit. Defaults to True. |
True
|
|
bool
|
If True, capture and return stdout. Defaults to False. |
False
|
|
Optional[str]
|
Working directory for the subprocess. Defaults to None. |
None
|
|
Optional[str]
|
Label used in debug log output. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
Optional[str]
|
Captured stdout as a string if capture is True, otherwise None. |