Ensure shell=True to work with single-string cmd

This commit is contained in:
awsr
2026-03-06 20:24:51 -08:00
parent c2087de473
commit 7657c5af29
+1 -2
View File
@@ -214,12 +214,11 @@ def sub_run(cmd: str, *args: str, **kwargs):
tuple[CompletedProcess[str], str]: Tuple with the results and the combined `stdout` and `stderr` values.
"""
options = {
"shell": True,
"check": False,
"env": os.environ,
}
options |= kwargs # Override defaults with passed kwargs
result = subprocess.run(f'"{cmd}" {" ".join(args)}', **options, capture_output=True, text=True)
result = subprocess.run(f'"{cmd}" {" ".join(args)}', **options, shell=True, capture_output=True, text=True)
result.stdout = result.stdout.strip()
result.stderr = result.stderr.strip()
txt = result.stdout