Execute a command. If 'quiet' is true, then redirect stdout and stderr to a temporary file.
(command, *, quiet, **kwargs)
| 186 | |
| 187 | |
| 188 | def call(command, *, quiet, **kwargs): |
| 189 | """Execute a command. |
| 190 | |
| 191 | If 'quiet' is true, then redirect stdout and stderr to a temporary file. |
| 192 | """ |
| 193 | print("❯", " ".join(map(str, command))) |
| 194 | if not quiet: |
| 195 | stdout = None |
| 196 | stderr = None |
| 197 | else: |
| 198 | stdout = tempfile.NamedTemporaryFile( |
| 199 | "w", |
| 200 | encoding="utf-8", |
| 201 | delete=False, |
| 202 | prefix="cpython-emscripten-", |
| 203 | suffix=".log", |
| 204 | ) |
| 205 | stderr = subprocess.STDOUT |
| 206 | print(f"📝 Logging output to {stdout.name} (--quiet)...") |
| 207 | |
| 208 | subprocess.check_call(command, **kwargs, stdout=stdout, stderr=stderr) |
| 209 | |
| 210 | |
| 211 | def build_platform(): |
no test coverage detected
searching dependent graphs…