From 13991bbef373a502caea40181eefc9ba252fe5bf Mon Sep 17 00:00:00 2001 From: Jasur Sadikov Date: Tue, 10 Sep 2024 09:38:33 +0200 Subject: [PATCH] `stdout` and `stderr` are displayed when async process is finished --- runner.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runner.py b/runner.py index 84a1cb2..5386313 100644 --- a/runner.py +++ b/runner.py @@ -211,11 +211,13 @@ async def _run_process(self, repo_path: str, table: Dict[str, List[str]], comman table[repo_path] = [line, f'{YELLOW}{utils.GLYPHS["running"]}'] self._print_process(table) + stdout, stderr = await process.communicate() return_code = await process.wait() + if return_code == 0: - status = f'{GREEN}{utils.GLYPHS["finished"]}{RESET}' + status = f'{GREEN}{utils.GLYPHS["finished"]}{RESET} {stdout.decode().replace("\n", " ")}' else: - status = f'{RED}{utils.GLYPHS["failed"]} Code: {return_code}{RESET}' + status = f'{RED}{utils.GLYPHS["failed"]} Code: {return_code}{RESET} {stderr.decode().replace("\n", " ")}' table[repo_path] = [table[repo_path][0], status] self._print_process(table)