improvement: replacing subprocess commands to detected installed CLIs by Python faster native calls (shutil.which)

This commit is contained in:
Vinicius Moreira
2021-06-15 17:09:49 -03:00
parent dfdc209374
commit 9a8772da8f
14 changed files with 36 additions and 37 deletions

View File

@@ -1,3 +1,4 @@
import shutil
from datetime import datetime
from typing import List, Tuple, Optional
@@ -6,8 +7,7 @@ from bauh.commons.system import new_subprocess, SimpleProcess
def is_installed() -> bool:
code, _ = system.execute(cmd='which git', output=False)
return code == 0
return bool(shutil.which('git'))
def list_commits(proj_dir: str) -> List[dict]: