mache.deploy.bootstrap.check_call

mache.deploy.bootstrap.check_call(commands, log_filename, quiet, *, capture_output=False, check=True, **popen_kwargs)[source]

Wrapper for making a shell call with logging and error management.

This function is intentionally similar to subprocess.run(), while still providing the project-specific logging and “tee” behavior.

Parameters:
  • commands (str or list[str]) – Either a single shell command string (possibly chaining commands with “&&” or “;”) or an argv-style command list for direct execution without a shell.

  • log_filename (str) – The path to the log file to append to

  • quiet (bool) – If True, only log to the log file, not to the terminal

  • capture_output (bool, optional) – If True, capture stdout (and merged stderr) and return it in the returned subprocess.CompletedProcess.

  • check (bool, optional) – If True (default), raise subprocess.CalledProcessError when the command returns a nonzero status.

  • **popen_kwargs – Additional keyword arguments passed through to subprocess.Popen.

Returns:

result (subprocess.CompletedProcess) – The result of the command. When capture_output is True, the combined output is available as result.stdout.