aboutsummaryrefslogtreecommitdiff
path: root/llvm_tools/subprocess_helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'llvm_tools/subprocess_helpers.py')
-rw-r--r--llvm_tools/subprocess_helpers.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm_tools/subprocess_helpers.py b/llvm_tools/subprocess_helpers.py
index d0c619cb..e1847c00 100644
--- a/llvm_tools/subprocess_helpers.py
+++ b/llvm_tools/subprocess_helpers.py
@@ -33,10 +33,21 @@ def check_call(cmd, cwd=None):
# FIXME: CTRL+C does not work when executing a command inside the chroot via
# `cros_sdk`.
-def ChrootRunCommand(chroot_path, cmd, verbose=False):
+def ChrootRunCommand(
+ chroot_path,
+ cmd,
+ verbose: bool = False,
+ chroot_name: str = "chroot",
+ out_name: str = "out",
+):
"""Runs the command inside the chroot."""
- exec_chroot_cmd = ["cros_sdk", "--"]
+ exec_chroot_cmd = [
+ "cros_sdk",
+ f"--chroot={chroot_name}",
+ f"--out-dir={out_name}",
+ "--",
+ ]
exec_chroot_cmd.extend(cmd)
return ExecCommandAndCaptureOutput(