(command, *, host=None, env=None, log=True, **kwargs)
| 111 | |
| 112 | |
| 113 | def run(command, *, host=None, env=None, log=True, **kwargs): |
| 114 | kwargs.setdefault("check", True) |
| 115 | if env is None: |
| 116 | env = os.environ.copy() |
| 117 | |
| 118 | if host: |
| 119 | host_env = android_env(host) |
| 120 | print_env(host_env) |
| 121 | env.update(host_env) |
| 122 | |
| 123 | if log: |
| 124 | print(">", join_command(command)) |
| 125 | return subprocess.run(command, env=env, **kwargs) |
| 126 | |
| 127 | |
| 128 | # Format a command so it can be copied into a shell. Like shlex.join, but also |
no test coverage detected