Installer script

This commit is contained in:
Vinicius Moreira
2019-06-13 14:56:03 -03:00
parent bf1175626a
commit d5142662eb
6 changed files with 126 additions and 11 deletions

6
core/system.py Normal file
View File

@@ -0,0 +1,6 @@
import subprocess
def run_cmd(cmd: str, expected_code: int = 0, ignore_return_code: bool = False) -> str:
res = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE)
return res.stdout.decode() if ignore_return_code or res.returncode == expected_code else None