MCPcopy Create free account
hub / github.com/ClangBuiltLinux/tc-build / run_cmd

Method run_cmd

tc_build/builder.py:47–63  ·  view source on GitHub ↗
(
        self, cmd: tc_build.utils.ValidCmd, capture_output: bool = False, cwd: Path | None = None
    )

Source from the content-addressed store, hash-verified

45 self.folders.build.mkdir(parents=True)
46
47 def run_cmd(
48 self, cmd: tc_build.utils.ValidCmd, capture_output: bool = False, cwd: Path | None = None
49 ) -> subprocess.CompletedProcess:
50 if self.show_commands:
51 # Acts sort of like 'set -x' in bash
52 print(f"$ {' '.join([shlex.quote(str(elem)) for elem in cmd])}", flush=True)
53 try:
54 return subprocess.run(
55 cmd, capture_output=capture_output, check=True, cwd=cwd, text=True
56 )
57 except subprocess.CalledProcessError as err:
58 if capture_output:
59 if err.stdout:
60 print(err.stdout)
61 if err.stderr:
62 print(err.stderr)
63 raise

Callers 7

buildMethod · 0.80
buildMethod · 0.80
configureMethod · 0.80
bolt_clangMethod · 0.80
buildMethod · 0.80
configureMethod · 0.80
buildMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected