mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
[flatpak] fix -> some environment variables are not available during the common operations
This commit is contained in:
@@ -66,7 +66,8 @@ class SimpleProcess:
|
||||
def __init__(self, cmd: List[str], cwd: str = '.', expected_code: int = 0,
|
||||
global_interpreter: bool = USE_GLOBAL_INTERPRETER, lang: str = DEFAULT_LANG, root_password: str = None,
|
||||
extra_paths: Set[str] = None, error_phrases: Set[str] = None, wrong_error_phrases: Set[str] = None,
|
||||
shell: bool = False):
|
||||
shell: bool = False,
|
||||
success_phrases: Set[str] = None):
|
||||
pwdin, final_cmd = None, []
|
||||
|
||||
self.shell = shell
|
||||
@@ -80,6 +81,7 @@ class SimpleProcess:
|
||||
self.expected_code = expected_code
|
||||
self.error_phrases = error_phrases
|
||||
self.wrong_error_phrases = wrong_error_phrases
|
||||
self.success_phrases = success_phrases
|
||||
|
||||
def _new(self, cmd: List[str], cwd: str, global_interpreter: bool, lang: str, stdin = None, extra_paths: Set[str] = None) -> subprocess.Popen:
|
||||
|
||||
@@ -186,6 +188,12 @@ class ProcessHandler:
|
||||
success = proc.instance.returncode == proc.expected_code
|
||||
string_output = output.read()
|
||||
|
||||
if proc.success_phrases:
|
||||
for phrase in proc.success_phrases:
|
||||
if phrase in string_output:
|
||||
success = True
|
||||
break
|
||||
|
||||
if not success and proc.wrong_error_phrases:
|
||||
for phrase in proc.wrong_error_phrases:
|
||||
if phrase in string_output:
|
||||
|
||||
Reference in New Issue
Block a user