mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 20:54:15 +02:00
improvement: replacing subprocess commands to detected installed CLIs by Python faster native calls (shutil.which)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import shutil
|
||||
from typing import List, Optional
|
||||
|
||||
from bauh.commons.system import SimpleProcess, run_cmd
|
||||
@@ -18,8 +19,7 @@ def install(url: str, name: str, output_dir: str, electron_version: Optional[str
|
||||
|
||||
|
||||
def is_available() -> bool:
|
||||
res = run_cmd('which nativefier', print_error=False)
|
||||
return res and not res.strip().startswith('which ')
|
||||
return bool(shutil.which('nativefier'))
|
||||
|
||||
|
||||
def get_version() -> str:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from bauh.commons.system import run_cmd
|
||||
import shutil
|
||||
|
||||
|
||||
def is_available() -> bool:
|
||||
res = run_cmd('which npm', print_error=False)
|
||||
return res and not res.strip().startswith('which ')
|
||||
return bool(shutil.which('npm'))
|
||||
|
||||
Reference in New Issue
Block a user