mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-11-10 23:30:56 +00:00
1d9dd966b1
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
15 lines
480 B
Python
15 lines
480 B
Python
import subprocess
|
|
|
|
|
|
def run_command(command, stdout=None, stderr=None):
|
|
stdout = stdout or subprocess.PIPE
|
|
stderr = stderr or subprocess.PIPE
|
|
process = subprocess.Popen(command, stdout=stdout, stderr=stderr)
|
|
out, error = process.communicate()
|
|
if process.returncode:
|
|
print("Something went wrong:")
|
|
print(f"return code: {process.returncode}")
|
|
print(f"stdout:\n{out}")
|
|
print(f"\nstderr:\n{error}")
|
|
exit(process.returncode)
|