mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
Ensure shell=True to work with single-string cmd
This commit is contained in:
+1
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user