[snap] feature -> new custom action 'change channel'

This commit is contained in:
Vinicius Moreira
2020-09-06 11:41:39 -03:00
parent c5e421d270
commit 2d395b608f
13 changed files with 126 additions and 30 deletions

View File

@@ -37,8 +37,13 @@ def downgrade_and_stream(app_name: str, root_password: str) -> SimpleProcess:
shell=True)
def refresh_and_stream(app_name: str, root_password: str) -> SimpleProcess:
return SimpleProcess(cmd=[BASE_CMD, 'refresh', app_name],
def refresh_and_stream(app_name: str, root_password: str, channel: Optional[str] = None) -> SimpleProcess:
cmd = [BASE_CMD, 'refresh', app_name]
if channel:
cmd.append('--channel={}'.format(channel))
return SimpleProcess(cmd=cmd,
root_password=root_password,
error_phrases={'no updates available'},
shell=True)