This commit is contained in:
Vinicius Moreira
2019-06-14 14:02:44 -03:00
parent 5f77f4dcb1
commit 3188820bc6
26 changed files with 67 additions and 18 deletions

6
fpakman/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