Skip to content

Commit

Permalink
stdout and stderr are displayed when async process is finished
Browse files Browse the repository at this point in the history
  • Loading branch information
jasursadikov committed Sep 10, 2024
1 parent 4379dcf commit 13991bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 13991bb

Please sign in to comment.