V 1.0 - Only Prints
This commit is contained in:
commit
5ac5b6615b
15 files changed
+1045
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import subprocess
|
||||
from typing import Optional, List
|
||||
|
||||
def run(cmd: subprocess._CMD) -> subprocess.CompletedProcess[str]:
|
||||
"""
|
||||
Run a subprocess command.
|
||||
|
||||
Args:
|
||||
cmd: Command and arguments as a list.
|
||||
|
||||
Raises:
|
||||
subprocess.CalledProcessError: If the command exits with a non-zero status.
|
||||
"""
|
||||
try:
|
||||
result = subprocess.run(
|
||||
cmd,
|
||||
check=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
text=True
|
||||
)
|
||||
return result
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(e.stdout)
|
||||
raise
|
||||
Reference in new issue
Block a user