(args, cwd, env, exit_on_error=True)
| 199 | |
| 200 | |
| 201 | def exec_and_log(args, cwd, env, exit_on_error=True): |
| 202 | log("executing %s" % " ".join(args)) |
| 203 | |
| 204 | p = subprocess.Popen( |
| 205 | args, |
| 206 | cwd=cwd, |
| 207 | env=env, |
| 208 | bufsize=1, |
| 209 | stdout=subprocess.PIPE, |
| 210 | stderr=subprocess.STDOUT, |
| 211 | ) |
| 212 | |
| 213 | for line in iter(p.stdout.readline, b""): |
| 214 | log(line.rstrip()) |
| 215 | |
| 216 | p.wait() |
| 217 | |
| 218 | log("process exited %d" % p.returncode) |
| 219 | |
| 220 | if p.returncode and exit_on_error: |
| 221 | sys.exit(p.returncode) |
| 222 | |
| 223 | |
| 224 | def find_vswhere(): |
no test coverage detected