mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
Installer script
This commit is contained in:
6
core/system.py
Normal file
6
core/system.py
Normal 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
|
||||
Reference in New Issue
Block a user