mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 01:44:15 +02:00
[snap] feature -> allowing to select an available channel during the installation process
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
import subprocess
|
||||
from io import StringIO
|
||||
from typing import Tuple
|
||||
from typing import Tuple, Optional
|
||||
|
||||
from bauh.commons.system import run_cmd, SimpleProcess
|
||||
|
||||
@@ -18,13 +18,16 @@ def uninstall_and_stream(app_name: str, root_password: str) -> SimpleProcess:
|
||||
shell=True)
|
||||
|
||||
|
||||
def install_and_stream(app_name: str, confinement: str, root_password: str) -> SimpleProcess:
|
||||
def install_and_stream(app_name: str, confinement: str, root_password: str, channel: Optional[str] = None) -> SimpleProcess:
|
||||
|
||||
install_cmd = [BASE_CMD, 'install', app_name] # default
|
||||
|
||||
if confinement == 'classic':
|
||||
install_cmd.append('--classic')
|
||||
|
||||
if channel:
|
||||
install_cmd.append('--channel={}'.format(channel))
|
||||
|
||||
return SimpleProcess(install_cmd, root_password=root_password, shell=True)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user